-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Verify this conf.
PostPosted: Thu May 07, 2009 4:03 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
DAOCOntext
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">




    <bean class="org.apache.commons.dbcp.BasicDataSource" id="dataSource" destroy-method="close" >
        <property name="driverClassName">
            <value>oracle.jdbc.driver.OracleDriver</value>
        </property>
       
        <property name="url">
            <value>xxx</value>
        </property>
        <property name="username">
            <value>xxx</value>
        </property>
       
        <property name="password">
            <value>xxx</value>
        </property>
        <property name="maxActive" value="100"/>
        <property name="maxWait" value="30000"/>
       

       
         
    </bean>


   

    <bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" />

    <bean
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" id="sessionFactory">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="lobHandler">
            <ref bean="lobHandler"/>
        </property>
        <property name="configLocation">

            <value>classpath:/hibernate.cfg.xml</value>

        </property>

         


    </bean>
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" />

    <bean  class="org.springframework.orm.hibernate3.HibernateTemplate" id="hibernateTemplate">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>


    </bean>



    <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>


 
 
</beans>


Last edited by void_void on Thu May 07, 2009 4:10 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Verify this conf.
PostPosted: Thu May 07, 2009 4:06 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
Hibernate.cfg.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url"></property>
        <property name="hibernate.connection.username"></property>
        <property name="hibernate.connection.password"></property>
        <property name="current_session_context_class">thread</property>
        <property name="hibernate.connection.pool_size">20</property>
        <property name="show_sql">true</property>
        <property name="hibernate.c3p0.max_size">50</property>
        <property name="hibernate.c3p0.min_size">2</property>
        <property name="hibernate.c3p0.timeout">5000</property>
        <property name="hibernate.c3p0.max_statements">100</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="hibernate.c3p0.acquire_increment">2</property>
        <property name="hibernate.c3p0.validate">false</property>
        <!--<property name="hibernate.jdbc.batch_size">20</property>
        <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
        <property name="hibernate.cache.use_query_cache">false</property> -->
        <property name="hibernate.connection.release_mode">after_transaction</property>
                 
    </session-factory>
</hibernate-configuration>



assuming all mapping class entries are fine.

is there any thing tin this conf that can hang up ?


Top
 Profile  
 
 Post subject: Re: Verify this conf.
PostPosted: Thu May 07, 2009 7:37 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
You could post your problem if there is one. In case you have no current problem, how about trying if it works? Obviously this config cannot work because there is no URL for the connection. If you edited your file for your posting you might have removed the problem so nobody can find out whats wrong.


Top
 Profile  
 
 Post subject: Re: Verify this conf.
PostPosted: Thu May 07, 2009 7:42 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
ofcourse i have removed url ,username, password..

but i want to know that if i use this configuration and use hibernate DAO + Spring.
for example

1. upon getHibernateTemplate.save(entity);
call will it create new connection or use the exesting ?
2. when it will release the connection ?
3. Suppose i load all data using getHibernateTemplate().load(); method will all object remain in memory? after execution or will it neeeded to flush .?


Top
 Profile  
 
 Post subject: Re: Verify this conf.
PostPosted: Tue May 12, 2009 12:34 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
Code:
hello . . .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.