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.  [ 2 posts ] 
Author Message
 Post subject: is database connection information cached?
PostPosted: Thu Oct 06, 2011 4:17 pm 
Newbie

Joined: Fri Apr 04, 2008 2:12 pm
Posts: 11
Hi,
I tried searching, and I could not find a solution to this problem.
I'm using Hibernate 3.3.2 with MySQL 5.0.45, Java 1.6.0_26, and jdbc 5.1.16. Normally, everything works fine. I can connect to my database, run my queries, and get my results. However, I ran into a situation after I started putting tables in different databases.

I'm getting the following error:

+ java -cp /home/bchin/testix/java/hibernate/bin/:/home/bchin/testix/0k/834 -Djava.ext.dirs=/sw/java/:/sw/java/jdbc/ de.laliluna.example.FormulaJoinTest 54
21:07:18,916 ERROR SchemaExport:202 - schema export unsuccessful
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: [11267] No such database: db828
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:28)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at de.laliluna.example.FormulaJoinTest.createTables(FormulaJoinTest.java:145)
at de.laliluna.example.FormulaJoinTest.main(FormulaJoinTest.java:55)
21:07:19,114 ERROR SchemaExport:202 - schema export unsuccessful
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

Now my FormulaJoinTest is suppose to connect to database db834, but I'm getting an error stating it can't find db828! That was a different test that ran on a different client that connected to a different mysql server about 4 minutes earlier. The only problem I can find is that these two tests are accessing my nfs mounted directory, /sw/java/, where the hibernate3.jar, jdbc, and all the other necessary libs are located. The config file, hibernate.cfg.xml, is not on the shared nfs file server either

config (hibernate.cfg.xml ) for database db834:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://foo:3306/db834</property>
<property name="connection.username">root</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>


config ((hibernate.cfg.xml ) for database db828:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://bar:3306/db828</property>
<property name="connection.username">root</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.password"></property>

What am I missing? Any help would be great!

Thanks,
Brad


Top
 Profile  
 
 Post subject: Re: is database connection information cached?
PostPosted: Mon Oct 10, 2011 1:00 pm 
Newbie

Joined: Fri Apr 04, 2008 2:12 pm
Posts: 11
it suddenly started working. this is odd. I can't explain why. Hopefully, I'll have an update for this.


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