-->
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: How to configure for "maybe" db access
PostPosted: Fri Nov 13, 2009 3:50 pm 
Newbie

Joined: Fri Sep 04, 2009 4:54 pm
Posts: 2
I'm a relative Hibernate noob. I've been searching for a couple of days for the answer to this, but I have yet to find one that meets my needs.

I've got an application that might write to a database when it is run. We are using spring to do our configuration. Right now, the application is configured to use a C3P0 pooled data source (because somebody copied it from our tomcat configuration), but it does not need a pooled data source.

The problem that I'm getting is that, when the db is not needed (and not available), C3P0 thinks it is a deadlock (I'm guessing because the deadlock detection occurs before the driver times out trying to connect). This gives me ugly errors in the output, which isn't acceptable as this is an externally used tool.

What I would like to do is have a configuration that doesn't attempt to connect to the database unless I actually perform an operation. If it fails then because the db is not available, that's fine.

Is this possible when using Spring to configure the datasource? Which datasource should I use? If not, what is the best strategy in this case?

Thanks!

tj


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.