-->
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: Hibernate tool and Derby problem
PostPosted: Sat Dec 31, 2005 10:52 am 
Newbie

Joined: Sat Dec 31, 2005 10:13 am
Posts: 1
Hi people.
Every time that I try to create a SessionFactory at Hibernate Configuration view I get this error...

Anybody knows about it?

thanks

Cristiano

Hibernate version: Hibernate Tools 3.1.0 beta2

Mapping documents:

<?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="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="hibernate.connection.url">jdbc:derby://localhost:1527/hawkDB</property>
<property name="hibernate.connection.username">cgaviao</property>
<property name="hibernate.connection.password">xxx</property>
<property name="hibernate.default_schema">cgaviao</property>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">0</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

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

Full stack trace of any exception that occurs:
WARN Worker-103 org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata

org.apache.derby.client.am.SqlException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
at org.apache.derby.client.am.Connection.checkForTransactionInProgress(Unknown Source)
at org.apache.derby.client.am.Connection.closeResourcesX(Unknown Source)
at org.apache.derby.client.am.Connection.closeX(Unknown Source)
at org.apache.derby.client.am.Connection.close(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.closeConnection(DriverManagerConnectionProvider.java:137)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:99)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1152)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:265)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:260)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:24)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


Name and version of the database you are using:
Apache Derby 10.1.1 and Eclipse 3.1.1


Top
 Profile  
 
 Post subject: I had the same problem with DB@
PostPosted: Tue Feb 28, 2006 4:13 am 
Newbie

Joined: Thu Jun 23, 2005 8:48 am
Posts: 4
I faced the same problem with DB2 .
After investigation i found that if u specify a scham in your confiuration then this schema much be define in the DB.

when the hibernate too try to access a schema that is not in the DB it give the following exception:

com.ibm.db2.jcc.a.SqlException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
at com.ibm.db2.jcc.a.p.r(p.java:1305)
at com.ibm.db2.jcc.a.p.u(p.java:1339)
at com.ibm.db2.jcc.a.p.s(p.java:1315)
at com.ibm.db2.jcc.a.p.close(p.java:1298)
at org.hibernate.connection.DriverManagerConnectionProvider.close(DriverManagerConnectionProvider.java:152)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:86)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:70)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:39)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:31)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)



The resolution is either to remove the line :

<property name="hibernate.default_schema">my_schema</property>

Or provide a valid already existing schema in this line.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 4:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
crazy db2/derby - why crash on asking if there exist tables in a non existing schema ? (or maybe it is some weird special state breaking something in the tools?)

_________________
Max
Don't forget to rate


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.