facebook

[Closed] Problem creating Hibernate mapping, Sybase, 4.1GA

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #245698 Reply

    Sergey Malov
    Member

    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

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.0 GA
    Build id: 20060122-4.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Platform

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse RCP

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Java Development Tools

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Plug-in Development Environment

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Project SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse 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 ———————————————

    #245721 Reply

    Brian Fernandes
    Moderator

    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.

    #245723 Reply

    Andreas Wicenec
    Participant

    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,
    Andreas

    #245725 Reply

    Brian Fernandes
    Moderator

    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.

    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.

    #245774 Reply

    Sergey Malov
    Member

    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 🙂

    Regards,
    Sergey

    #245912 Reply

    Brian Fernandes
    Moderator

    Seedless, your query has been moved since it does not pertain to Sybase: https://www.genuitec.com/forums/topic/closed-hibernate-reverse-engineering-problem-mysql/

    #246711 Reply

    Haris Peco
    Member

    Malov,

    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)

    Best

    #246858 Reply

    Sergey Malov
    Member

    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,
    Sergey

    #246859 Reply

    Haris Peco
    Member

    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)

    Best

    #247140 Reply

    Sergey Malov
    Member

    Just curious, when this new release is going to happen? It’s late February on my watches 🙂

    Regards,
    Sergey

    #247142 Reply

    Riyad Kalla
    Member

    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.

    #259202 Reply

    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
    –Sreecharan

    #259208 Reply

    Haris Peco
    Member

    Sreecharan,

    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.7

    If you have further issues send us log
    Windows-Show View-Other-PDE runtime-Error log View

    … and please, open new thread

    Best
    Peco

    #259367 Reply

    Thank you very much,
    It worked!!! 🙂

    Regards
    –Sreecharan

    #259739 Reply

    Riyad Kalla
    Member

    Glad it’s working.

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: [Closed] Problem creating Hibernate mapping, Sybase, 4.1GA

You must be logged in to post in the forum log in