-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate Jndi datasource mapping problem
PostPosted: Tue Jul 27, 2010 3:12 am 
Newbie

Joined: Tue Jul 27, 2010 2:53 am
Posts: 1
Dear all,

Please help me

i am using connection.datasource through jndi in hibernate.cfg file to connect database , it works fine .

i lost connection after 8 hours if my application idle, so i used c3p0 in hibernate.cfg. c3p0 is working well if didnt use JNDI datasource . but i want to use JNDI and c3p0 in hibernate.cfg file



MY configuration file

<hibernate-configuration>

<session-factory>

<!--<property name="connection.driver_class">-->
<!-- org.gjt.mm.mysql.Driver-->
<!-- </property>-->
<!-- <property name="connection.url">jdbc:mysql://localhost:3306/dbname</property>-->
<!---->
<!---->
<!-- <property name="connection.username">root</property>-->
<!-- <property name="connection.password">root</property>-->
<!-- -->



<property name="connection.datasource">java:jndiname</property>


<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="connection.datasource">java:pic</property>
<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">20</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.max_statements">50</property>



<mapping resource="persistantDB/ApplicationConfig.hbm.xml" />
<mapping resource="persistantDB/CheckInStatus.hbm.xml" />
<mapping resource="persistantDB/CheckInBackup.hbm.xml" />
<mapping resource="persistantDB/DeviceTable.hbm.xml" />

</session-factory>

</hibernate-configuration>


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

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.