-->
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: Feature request: C3P0 property
PostPosted: Wed Sep 10, 2003 2:19 pm 
Newbie

Joined: Wed Sep 10, 2003 1:21 pm
Posts: 6
Hi,

I have a need to set a C3P0 property that is not included in the standard set of Hibernate properties.

I am using Hibernate with mySQL and dynamically created and configured databases. This makes it difficult to use configured datasources from the application server. DBCP also does not like this enviroment, failing to perform a schema export with an existing connection pool in use.

I am therefore using C3P0, which works well (so far) but for one flaw, C3P0 by default attempts to rollback any uncommitted transactions on connection close. Now, mySQL by default has autocommit turned on, so I cannot call commit on the connection (I get an exception if I do), and I am in a catch 22 situation.

The way out is to set C3P0's 'c3p0.autoCommitOnClose' property to true, which I have done in a hacked version of Hibernate on C3P0ConnectionProvider.java. The javadoc for com.mchange.v2.c3p0.PoolConfig describes this property in more detail. If I do this, everything works fine.

If I've missed anything, please let me know.

My request would be to add a hibernate property, say 'hibernate.c3p0.autocommit', to set the relevant property in C3P0's PoolConfig class.

Thanks
Craig


BTW, I also tried to use Proxool, but found that it is impossible to use the hibernate.proxool.* type properties, since specifying hibernate.connection.url will give you a DriverManagerConnectionProvider, but ProxoolConnectionProvider requires hibernate.connection.url if the configuration does not come from an external file. Changing the if/else order in ConnectionProviderFactory may be a good way to fix it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 2:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
create a patch and submit it to jira. i will accept this one


and yes, looks like you're right about the proxool stuff too ... funny, I never noticed before ... i always got it to work .....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 3:13 pm 
Newbie

Joined: Wed Sep 10, 2003 1:21 pm
Posts: 6
CVS on sourceforge seems to be down, I'll try again later...

Should I submit a patch for the Proxool issue as well?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 3:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
yeah, do 'em both

make sure you create patches against the v21branch!

:)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2003 6:12 am 
Newbie

Joined: Wed Sep 10, 2003 1:21 pm
Posts: 6
Patches added to JIRA:

C3P0:
http://opensource.atlassian.com/project ... key=HB-322

Proxool:
http://opensource.atlassian.com/project ... key=HB-323


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.