-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate Tools and Db2 Reverse engineering problem
PostPosted: Fri Apr 21, 2006 12:37 pm 
Regular
Regular

Joined: Wed May 05, 2004 3:41 pm
Posts: 118
Location: New Jersey,USA
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Hibernate Tools build 3.1.0.beta3,
Eclipse Version:Version: 3.1.2
Build id: M20060118-1600


Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
!ENTRY org.eclipse.ui 4 0 2006-04-21 12:13:41.373
!MESSAGE COM.ibm.db2.jdbc.app.DB2DatabaseMetaData.supportsResultSetType(I)Z
!STACK 0
java.lang.AbstractMethodError: COM.ibm.db2.jdbc.app.DB2DatabaseMetaData.supportsResultSetType(I)Z
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:80)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1855)
at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:377)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at org.hibernate.console.ConsoleConfiguration.getSettings(ConsoleConfiguration.java:374)
at org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor.getLazyDatabaseSchema(ReverseEngineeringEditor.java:163)
at org.hibernate.eclipse.mapper.editors.reveng.TableFilterFormPart$1.doRefreshTree(TableFilterFormPart.java:39)
at org.hibernate.eclipse.console.wizards.TreeToTableComposite$5.widgetSelected(TreeToTableComposite.java:316)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

Name and version of the database you are using: Db2 v8

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 2:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
upgrade your driver

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 22, 2006 9:21 am 
Regular
Regular

Joined: Wed May 05, 2004 3:41 pm
Posts: 118
Location: New Jersey,USA
This the driver I've been using for all my application. I think I'm using the Type 2 driver for DB2. Is there a link for a newer driver?[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 22, 2006 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well your driver doesn't implement the correct method.

don't know about new link, check at IBM

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 12:00 pm 
Regular
Regular

Joined: Wed May 05, 2004 3:41 pm
Posts: 118
Location: New Jersey,USA
I modified the Driver JAR and now I'm getting this exception. I had a similar issue with using Apache Derby's configuration as well.

2006-04-24 11:56:39,856 30 [ Worker-4] WARN riverManagerConnectionProvider - problem closing pooled connection
com.ibm.db2.jcc.b.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.b.l.j(l.java:556)
at com.ibm.db2.jcc.b.l.close(l.java:540)
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)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 12:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
weird stuff - but only a warning.

tell me how i can reproduce it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 6:11 am 
Newbie

Joined: Thu May 11, 2006 5:52 am
Posts: 1
Location: Paris
I'm getting the same exception, but no warning.
I use hibernate 2.x in a J2SE environnement with JTA support and IBM DB2. With the DB2 Universal Driver (type 4 = com.ibm.db2.jcc.DB2XADataSource) i've got :

com.ibm.db2.jcc.b.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.b.o.r(o.java:1260)
at com.ibm.db2.jcc.b.o.w(o.java:1303)
at com.ibm.db2.jcc.a.c.w(c.java:579)
at com.ibm.db2.jcc.b.wb.close(wb.java:65)
at .........jdbc.MyOwnDataSource.closeConnection(MyOwnDataSource.java:110)
at net.sf.hibernate.impl.BatcherImpl.closeConnection(BatcherImpl.java:311)
at net.sf.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:3399)
at net.sf.hibernate.impl.SessionImpl.close(SessionImpl.java:586)
at com.manpower.socle.database.hibernate.HibernateSession.close(HibernateSession.java:517)

This doesn't append with the old native type 2 driver : COM.ibm.db2.jdbc.DB2XADataSource (yes, COM in upper case).

Follow this link for additionnal IBM comments on this exception : http://www-128.ibm.com/developerworks/w ... tchie.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 16, 2006 3:00 am 
Regular
Regular

Joined: Wed May 05, 2004 3:41 pm
Posts: 118
Location: New Jersey,USA
The steps I followed to configure Hibernate Tools after installing the plugin

1. Configured a new Hivernate Configration and Console. The Hibernate Configuration XML is as below

Code:
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
        <property name="hibernate.connection.password">b2b1010</property>
        <property name="hibernate.connection.url">jdbc:db2://comb:50000/eb30apts</property>
        <property name="hibernate.connection.username">ebb2bgrp</property>
        <property name="hibernate.default_schema">elecelig</property>
        <property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
    </session-factory>
</hibernate-configuration>



Note: I am use the Type 4 JDBC driver for DB2. I tried the Type 2 as well and the result is same.
Then I create a new Reverse Engineering Configuration and when I click on "Refresh" to get the schema/table details, it throws the error I pasted earlier in the Log.

For Derby, when I refresh I am able to get the table listing, but when I use the "Code generation" utility, it errors out and a similar error message is received for Derby as well.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 16, 2006 3:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try and enable autocommit

_________________
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.  [ 9 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.