MyEclipse: [Closed] Problem creating Hibernate mapping, Sybase, 4.1GA malov - Jan 31, 2006 - 12:36 AM Post subject: [Closed] Problem creating Hibernate mapping, Sybase, 4.1GA
While trying to create hibernate mapping for my db tables (Sybase ASE 12.5.3), I got a message
---- An internal error occurred during: "Generating Artifacts".
Further investigating I found that SQL Message causing error is (it can be seen from the error log below):
---- The 'CREATE TABLE' command is not allowed within a multi-statement transaction in the 'tempdb' database.
This error in Sybase can be avoided by setting "ddl in tran" option for tempdb to "true", and that's what I did in my case to solve this problem. However, I must note that Sybase itself does not recommend doing so in its manual, suggesting instead to use permanent objects:
---- Quote from the manual ----
Using data definition language commands on tempdb within transactions may cause concurrency problems in tempdb. Always leave ddl in tran set to FALSE in tempdb!
---- End of quote ------
Although it's not technically a bug (requirement to set "ddl in tran" to "true" for Sybase server), I would be very much like to know how to get around this problem, because, for example, it will prevent me from using this otherwise very interesting plugin at work, where setting options for databases is not something I'm allowed to do.
Regards,
Sergey
----------------------------------- Configuration ----------------------------------------
*** Date: Mon Jan 30 19:22:33 EST 2006
*** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_05
!ENTRY org.eclipse.core.runtime 4 2 2006-01-29 22:17:26.897
!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
org.hibernate.exception.GenericJDBCException: Error while reading column meta data for Library.dbo.Author
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:231)
at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:434)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:67)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:82)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:85)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:109)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:393)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:388)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: The 'CREATE TABLE' command is not allowed within a multi-statement transaction in the 'tempdb' database.
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source)
at com.sybase.jdbc3.jdbc.SybCallableStatement.executeQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.if(Unknown Source)
at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getColumns(Unknown Source)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:209)
... 11 more
------------------------------------------ End of error log ---------------------------------------------Support-Brian - Jan 31, 2006 - 08:50 AM Post subject:
Malov,
There is no known work around for this behaviour right now, it was only recently that another user brought it to our notice; but we didn't realize it was a problem as you pointed out.
I have filed an investigative report so that we can take a look at this internally, but for now I'm afraid you just have to set that option to true in order to use our tools with Sybase.
Best,
Brian.wici - Jan 31, 2006 - 09:02 AM Post subject:
Malov, Brian
we found exactly the same problem the other day and this is quite annoying, because we are certainly not allowed to set the "ddl in tran" flag to true in tempdb, since it is not recommended. In addition to your finding we've also tried myEclipse 4.0.3 and the hibernateTools and interestingly enough it still worked with 4.0.3 and also with the older version of the hibernateTools, but not with the latest 4.1GA and the latest hibernateTools.
Regards,
AndreasSupport-Brian - Jan 31, 2006 - 09:33 AM Post subject:
Andreas,
Thank you for chipping in with your experience. We changed our Hibernate tooling to use the Hibernate Tools project since 4.1M2, so the older tooling (pre 4.1M2) would still work, albeit it was neither as powerful nor as flexable.
Quote:
interestingly enough it still worked with 4.0.3 and also with the older version of the hibernateTools, but not with the latest 4.1GA and the latest hibernateTools.
When you say older version of hibernate tools, are you referring to our hibernate tools in 4.0.3 or are you referring to the open source Hibernate Tools project? Similarly, when you say latest hibernateTools, could you please clarify what you are referring to?
Best,
Brian.malov - Jan 31, 2006 - 07:43 PM Post subject:
Brian, Andreas,
Thank you for your replies.
Brian, if there will be any changes in this behaviour in the future, let me know. Frankly, I think it would be a good idea, since there are still a lot of us, poor souls, who have to work with Sybase once in a while to get some money for living :)
I can reproduce your problem with simple schema.It will be resolved in next release Please, send us your schema for added testing (if you can do it)
You can try with next workaround, too : start eclipse with options
-vmargs -Dhibernate.connection.autocommit=true
Sybase (and MSSQL too, it is same engine) have bad locking mechanism and it is reason for this problem/bug
(it is reason for 'ddl in tran' at all)
Bestmalov - Feb 16, 2006 - 02:19 AM Post subject:
Sorry for a late response, I thought the matter is resolved and didn't check for messages. I'll try this workaround next time I work with the project.
I can send you db schema if it's still needed, where do you want me to it?
Regards,
Sergeysupport-snpe - Feb 16, 2006 - 02:28 AM Post subject:
malov,
We resolve this bug (sybase problem) and this workaround can help you temporary.
When you start with this option you can't execute stored procedures - it will be resolved in 4.1.1 (late Februar)
I would like try with your schema and you can send on forum or to private mail (click on link 'You have X new messages' or 'You have no new messages' and you will see link for send private mail)
Bestmalov - Feb 21, 2006 - 04:35 PM Post subject:
Just curious, when this new release is going to happen? It's late February on my watches :)
Regards,
Sergeysupport-rkalla - Feb 21, 2006 - 04:53 PM Post subject:
Later February, towards the end. We are actually surprised how much we got into 4.1.1, it's going to be a great release.SreecharanPannala - Sep 25, 2006 - 10:08 PM Post subject: An internal Error occurred while Generating Artifacts
Hi,
I am new to this forum. Please bear with me.
I am using Oracle 8 as my DB, Win-XP, My-Eclipse 4.1.1.
I added the classes12.zip file for connecting to the DB but i still get the same error
"An internal Error occurred while Generating Artifacts". while generating the mapping files using Hibernate capabilities on My-Eclipse. :?
Could anybody please suggest me what to do to get rid of this error?
Please suggest me a step-by-step process if there is any.
Thanks in advance
--Sreecharansupport-snpe - Sep 25, 2006 - 11:20 PM Post subject:
Sreecharan,
If you have further issues send us log
Windows-Show View-Other-PDE runtime-Error log View
... and please, open new thread
Best
PecoSreecharanPannala - Sep 27, 2006 - 05:38 PM Post subject: No more Errors while generating the Mapping files
Thank you very much,
It worked!!! :-)
Regards
--Sreecharansupport-rkalla - Oct 03, 2006 - 01:23 AM Post subject:
Glad it's working.