-->
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, c3p0, and mysql user authentication
PostPosted: Tue Jun 10, 2008 12:44 pm 
Regular
Regular

Joined: Tue Oct 10, 2006 2:21 pm
Posts: 58
Hibernate version: 3.2

I am developing an application that talks to a MySQL database using Hibernate. This application is standalone java, no container services.

It mostly worked except that I noticed that the connections would not stay up overnight, requiring application restart.

Looking at the documentation, it seemed that I would be well-advised to use connection pooling. So I configured my application to use C3P0 with all the relevant properties. Running against my local instance of MySQL, all was well and my stale connection problem seemed solved.

As soon as I moved the application configured for C3P0 onto the development server however, No database connectivity could take place.

2008-06-10 12:04:43,221
[Task-Thread-for-com.mchange.v2.async.ThreadPerTaskAsynchronousRunner@160a26f] DEBUG resourcepool.BasicResourcePool - An exception occurred while acquiring a poolable resource. Will retry.
java.sql.SQLException: Access denied for user 'myuser'@'server.mydomain.com' (using password: YES)

My Hibernate configuration file names the user as simply myuser.

Should I instead be naming him as 'myuser'@'server.mydomain.com'? Does C3PO have a different way of putting the username together than straight Hibernate does. Or should I specifically add a user called 'myuser'@'server.mydomain.com'? to the database users table? I know mysql is finicky about this.


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.