-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with Sybase and 3.1.2
PostPosted: Thu Mar 23, 2006 11:35 am 
Newbie

Joined: Thu Mar 23, 2006 11:14 am
Posts: 6
Hibernate version:3.1.2

Hi,

I use a Sybase DB and jconn3 as my jdbc driver. I upgraded from version 3.0 to 3.1.2 and at init of SessionFactory I got exceptions like:
Code:
DEBUG impl.NewPooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@1bd7848 handling a throwable.
com.sybase.jdbc3.utils.UnimplementedOperationException: The method com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getDatabaseMajorVersion() has not been completed and should not be called.
   at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(ErrorMessage.java:957)
   at com.sybase.jdbc3.utils.Debug.notImplemented(Debug.java:387)
   at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getDatabaseMajorVersion(SybDatabaseMetaData.java:2271)
   at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getDatabaseMajorVersion(NewProxyDatabaseMetaData.java:3678)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.hibernate.cfg.SettingsFactory.getDatabaseMajorVersion(SettingsFactory.java:293)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
   at my.package.util.HibernateUtil.init(HibernateInventoryUtil.java:18)
...


This seems like a bug in Hibernate or jconn. Another exception:
Code:
DEBUG sql.SqlUtils: Converting Throwable to SQLException...
com.sybase.jdbc3.utils.UnimplementedOperationException: The method com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getDatabaseMajorVersion() has not been completed and should not be called.
   at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(ErrorMessage.java:957)
   at com.sybase.jdbc3.utils.Debug.notImplemented(Debug.java:387)
   at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getDatabaseMajorVersion(SybDatabaseMetaData.java:2271)
   at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getDatabaseMajorVersion(NewProxyDatabaseMetaData.java:3678)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.hibernate.cfg.SettingsFactory.getDatabaseMajorVersion(SettingsFactory.java:293)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)

After init of SessionFactory I see
Code:
DEBUG impl.NewPooledConnection: A Throwable occurred while trying to reset the typeMap property of our Connection to Collections.EMPTY_MAP!
com.sybase.jdbc3.utils.UnimplementedOperationException: The method com.sybase.jdbc3.jdbc.SybConnection.setTypeMap(java.util.Map) has not been completed and should not be called.
   at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(ErrorMessage.java:957)
   at com.sybase.jdbc3.utils.Debug.notImplemented(Debug.java:387)
   at com.sybase.jdbc3.jdbc.SybConnection.setTypeMap(SybConnection.java:2010)
   at com.mchange.v2.c3p0.impl.NewPooledConnection.reset(NewPooledConnection.java:290)
   at com.mchange.v2.c3p0.impl.NewPooledConnection.markClosedProxyConnection(NewPooledConnection.java:247)
   at com.mchange.v2.c3p0.impl.NewProxyConnection.close(NewProxyConnection.java:1148)
   at org.hibernate.connection.C3P0ConnectionProvider.closeConnection(C3P0ConnectionProvider.java:42)
   at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:388)
   at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:343)
   at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:230)
   at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:221)
   at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:437)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:833)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:821)


My code seems to work though. My call to session.get(...) returns an object. Any ideas?

Regards,
Dag W.


Top
 Profile  
 
 Post subject: 2c
PostPosted: Thu Mar 23, 2006 6:00 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Do not let H to try to update and create DB schema,
remove hibernate.hbm2ddl.auto parameter from hibernate configuration.
It will also speed up the startup time

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 24, 2006 5:15 am 
Newbie

Joined: Thu Mar 23, 2006 11:14 am
Posts: 6
I don't have H update my schema. Inserting hibernate.hbm2ddl.auto=false doesn't help.

The exceptions show up not only on init, but also later when closing session for instance.

The exceptions seem to be non-fatal.


Top
 Profile  
 
 Post subject: c3p0
PostPosted: Fri Mar 24, 2006 2:12 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
OK,did a bit of digging and the issue has nothing to do with Hibernate but the way c3p0 is implemented.

It is ignorable because it is fully swallowed at c3p0 level and affects nothing except performance
try
{ if (supports_setTypeMap) physicalConnection.setTypeMap( Collections.EMPTY_MAP ); }
catch ( Throwable t )
{
if (logger.isLoggable( MLevel.FINE ))
logger.log(MLevel.FINE, "A Throwable occurred while trying to reset the typeMap property of our Connection to Collections.EMPTY_MAP!", t);
}
}

supports_setTypeMap is set bu utility method that simply checks if the setTypeMap method is present in the target connection class.

Possible solutions:
- ignore;
- change c3p0 code;
- use AspectJ to permanently weave setTypeMap code of the JDBC driver to not to throw "NotImplemented" exception;

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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