-->
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.  [ 12 posts ] 
Author Message
 Post subject: Artifact Generation from Sybase ASE 12.0
PostPosted: Wed May 11, 2005 3:27 pm 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
Hi,
I'm trying to use the eclipse plugins against a Sybase Adaptive Server Enterprise Version 12.0.0.8 using jConnect 5.5 and 6.0.

Trying to do the Artifact Generation, the process gives the following exception:

org.hibernate.exception.GenericJDBCException: Reading from database
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:122)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:39)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:77)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: java.sql.SQLException: JZ0R2: No result set for this query.
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(ErrorMessage.java:572)
at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(SybStatement.java:1720)
at com.sybase.jdbc3.jdbc.SybCallableStatement.executeQuery(SybCallableStatement.java:103)
at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.returnResults(SybDatabaseMetaData.java:2541)
at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getColumns(SybDatabaseMetaData.java:1983)
at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:714)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:103)
... 8 more

I'm using eclipse 3.1M6, hibernate 3.0.3, and have checked out HibernateExt from cvs in the morning (GMT-3).
The plugins builded Ok despite a forgotten call to a deleted method in org.hibernate.eclipse.console.wizards/ArtifactGeneratorWizard.java (line 206: cfg.setGeneratingDynamicClasses(false);).

The exception is thrown when the process tries to obtain the column info from the user tables in the database,
I write a small program to do the same directly with a jdbc connection and all worked fine ...
Has anyone have success in doing this process ?
Any clue or sugestion will be appreciated.
Thank you all and best regards,

José Luis


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 11, 2005 5:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and this does not work with the latest from CVS ?

it looks like a driver bug to me ,(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 8:44 am 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
max wrote:
and this does not work with the latest from CVS ?

it looks like a driver bug to me ,(


That's right. The plugings were made with a cvs checkout performed yesterday in the morning.

At the driver's level, I note a diferent behavior in the sequence of methods used when embeded in hibernate than when used in the stand alone program that I write.
I can't find if this diference is a result of the sybase "dialect" or not.
I 'll keep searching the code for a clue, but it would be appreciated to know if anyone has used succesfully this plugin with Sybase.
Thank you alot in advance.
Regards,

José Luis


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 8:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the reverse engineering is not controlled by the dialect.

we just use standard jdbc metadata..

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 8:58 am 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
max wrote:
the reverse engineering is not controlled by the dialect.

we just use standard jdbc metadata..

/max


Ok, thank you Max.
It appears that that's the problem.
The sequence of methods called that appears in the exception, in relation to the DatabaseMetaData is different to the sequence that I obtained in my few lines program ...
I'll search further in this topic and keep you informed if I found a work-around or the final cause of the problem.
Thanks again.
Regards,

José Luis


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 1:31 pm 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
Hi Max,

Well some advance on this topic.
The problem appears to be in the hibernate own connection pool algorithm.
I placed the c3p0 connection pool options in hibernate.properties and the getColumns method worked as spected.
Now, this unveiled other problem with the Sybase JDBC driver.
This driver uses stored procedures to obtain some database metadata info. in particular, uses sp_jdbc_primarykey stored procedure to obtain primary key info of a table. The problem is that this procedures can not run inside transactions ... :-( ... so the natural question is: are there any way to disable transaction during the artifact generation ?
It would be nice that this were posible in order to fix this problem with Sybase access.
Thank you in advance for your help and ... of course ... for the source clarity ...
Regards,

José Luis


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 2:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
You mean it must run with autocommit or what ?

add it to the jira - but i really dont get how a stored procedure cant run within a transaction ?!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 3:27 pm 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
max wrote:
You mean it must run with autocommit or what ?

add it to the jira - but i really dont get how a stored procedure cant run within a transaction ?!


Max,

No, some Sybase system stored procedures can not be run inside a user defined transaction because they do some operations that were not logged so, it could not be rolled back.

Now, what should I post in jira ?
Please, I'm a newbie in this forum and don't wanto to commit errors ...
Thanks alot for your prompt reply.
Regards,

José Luis


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 3:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
since i don't have a sybase installation you must tell me (preferably by providing a patch) what operations on the connection I have to do to avoid erroring on sybase.

And then I can decide if it is something we can abstract away so it does not mean all databases need to run with autocommit.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 3:56 pm 
Newbie

Joined: Wed Apr 13, 2005 10:36 am
Posts: 6
Location: Uruguay
max wrote:
since i don't have a sybase installation you must tell me (preferably by providing a patch) what operations on the connection I have to do to avoid erroring on sybase.

And then I can decide if it is something we can abstract away so it does not mean all databases need to run with autocommit.

-max


Ok, Max, I'll dig deeper in the code and keep you informed.
Regards,

José Luis


Top
 Profile  
 
 Post subject: sp_jdbc_primarykey can not be run in a transaction,any idea?
PostPosted: Fri Jan 20, 2006 1:52 pm 
Newbie

Joined: Fri Jan 20, 2006 1:45 pm
Posts: 1
Hi,

Am using the hibernate tools 3.1 beta 2 with Eclipse IDE 3.1 which I was trying to reverse engineer some tables from the Sybase 12 database.

This is what I get when trying to follow the tools documentation

org.hibernate.exception.GenericJDBCException: Error while reading primary key meta data for d17_trading.dbo.trade_feed
com.sybase.jdbc2.jdbc.SybSQLException: Catalog procedure 'sp_jdbc_primarykey' can not be run in a transaction.
com.sybase.jdbc2.jdbc.SybSQLException: Catalog procedure 'sp_jdbc_primarykey' can not be run in a transaction.

Any Help will be greatly appreciated

Many Thanks,
tom


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 4:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as the thread (and others) suggests: to read metadata in sybase you have to either run without transactions (set auto_commit to true) or enable some flag that i can't remember anymore.

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