- This topic has 14 replies, 6 voices, and was last updated 18 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
Sergey MalovMemberWhile 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*** MyEclipse details:
MyEclipse Enterprise WorkbenchVersion: 4.1.0 GA
Build id: 20060122-4.1-GA*** Eclipse details:
Eclipse SDKVersion: 3.1.1
Build id: M20050929-0840Eclipse Platform
Version: 3.1.1
Build id: M20050929-0840Eclipse RCP
Version: 3.1.1
Build id: M20050929-0840Eclipse Java Development Tools
Version: 3.1.1
Build id: M20050929-0840Eclipse Plug-in Development Environment
Version: 3.1.1
Build id: M20050929-0840Eclipse Project SDK
Version: 3.1.1
Build id: M20050929-0840Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-launcher
C:\Development\eclipse\eclipse.exe
-name
Eclipse
-showsplash
600
-exitdata
1f8_38
-vm
C:\WINDOWS\system32\javaw.exe
——————————————- End of Configuration ——————————–——————————— Error log ——————————————
!SESSION 2006-01-29 22:15:48.804 ———————————————–
eclipse.buildId=M20050929-0840
java.version=1.5.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86!ENTRY com.genuitec.eclipse.core 1 0 2006-01-29 22:15:52.694
!MESSAGE Unable to locate .myeclipse.properties file!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 ———————————————
Brian FernandesModeratorMalov,
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.
Andreas WicenecParticipantMalov, 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,
Andreas
Brian FernandesModeratorAndreas,
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.
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.
Sergey MalovMemberBrian, 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 🙂Regards,
Sergey
Brian FernandesModeratorSeedless, your query has been moved since it does not pertain to Sybase: https://www.genuitec.com/forums/topic/closed-hibernate-reverse-engineering-problem-mysql/
Haris PecoMemberMalov,
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=trueSybase (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)Best
Sergey MalovMemberSorry 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,
Sergey
Haris PecoMembermalov,
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)
Best
Sergey MalovMemberJust curious, when this new release is going to happen? It’s late February on my watches 🙂
Regards,
Sergey
Riyad KallaMemberLater February, towards the end. We are actually surprised how much we got into 4.1.1, it’s going to be a great release.
SreecharanPannalaMemberHi,
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
–Sreecharan
Haris PecoMemberSreecharan,
Try with ojdbc14.jar (jdbc for java 1.4/5.0) – you can find driver on http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
jdbc driver version 9 and 10 will work with datbase >= 8.1.7If you have further issues send us log
Windows-Show View-Other-PDE runtime-Error log View… and please, open new thread
Best
Peco
SreecharanPannalaMemberThank you very much,
It worked!!! 🙂Regards
–Sreecharan
Riyad KallaMemberGlad it’s working.
-
AuthorPosts