-->
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.  [ 3 posts ] 
Author Message
 Post subject: MS SQL Server problem
PostPosted: Mon Mar 28, 2005 9:33 am 
Newbie

Joined: Thu Mar 24, 2005 10:07 am
Posts: 14
I hope someone can help with this problem, Ive got hibernate up and working but with connection pooling theres a problem. When I start the app the pool initializes. But if i recompile any classes without restarting tomcat the next time a servlet hits the db, it creates a new connection to db and doesnt reuse the available conn in the pool. This results in double the number of active connections to sql server. This also happens if i let the app sit idle for a few hours and come back to it and re-hit the servlet. Can anyone tell me why this is happening and how to avoid it.

db and app server are separate machines.

But when switch the app to use mysql, i can restart the database server without restarting the app server and it re-makes the pool on next connect. Works fine.

Anyone help?


env below.

Hibernate 2.1.8 running on tomcat 5.0.28

Mapping doc:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/PCMExchange</property>
<property name="show_sql">false</property>
<!--<property name="dialect">org.hibernate.dialect.SQLServerDialect</property> -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Mapping files -->
<mapping resource="Investor.hbm.xml"/>
<mapping resource="Offering.hbm.xml"/>
<mapping resource="Contact.hbm.xml"/>
<mapping resource="PrevYearRevenue.hbm.xml"/>
<mapping resource="Location.hbm.xml"/>
<mapping resource="PrevYearNetIncome.hbm.xml"/>
<mapping resource="PrevYearPreTaxIncome.hbm.xml"/>
<mapping resource="TotalAssets.hbm.xml"/>
<mapping resource="LongTermDebt.hbm.xml"/>
<mapping resource="ShortTermDebt.hbm.xml"/>
<mapping resource="StockholderEquity.hbm.xml"/>
<mapping resource="NumberShareHolders.hbm.xml"/>
<mapping resource="Sector.hbm.xml"/>
<mapping resource="Company.hbm.xml"/>
<mapping resource="Revenue.hbm.xml"/>
<mapping resource="SICCode.hbm.xml"/>

</session-factory>
</hibernate-configuration>

DB MS Sql server -> MS Sql Server driver with DBCP pooling


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 11:28 am 
Newbie

Joined: Wed Jan 05, 2005 12:30 pm
Posts: 17
Location: Philadelphia, PA
What JDBC Driver are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 4:49 pm 
Newbie

Joined: Thu Mar 24, 2005 10:07 am
Posts: 14
Sorry.. JTDS.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.