-->
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.  [ 7 posts ] 
Author Message
 Post subject: Problem with the Hibernate Artifact generation
PostPosted: Tue Nov 14, 2006 12:05 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
Hi all,
I'm tearing my hair off with the Artifact generator.
I need to generate mapping files and POJOS. As the documentation explains it, I'm using the plugin(within eclipse) to create Hibernate configuration file and the console configuration.
After these steps, I can browse and the database table I'd like to generate mapping files.
But when I launche the code generation launcher, generation fails with an error message about meta data access.

the config file that is generated seems correct and the user has the sufficient privileges to acces the db.
I reaaly don't know why I'm getting this frustrating error.
I'm sending my config fiel below. Any help would be greetly appreciated.

Meissa


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="sso">
<property name="hibernate.connection.driver_class">com.sybase.jdbc2.jdbc.SybDriver</property>
<property name="hibernate.connection.password">4sso4user</property>
<property name="hibernate.connection.url">jdbc:sybase:Tds:s198000AMSB:4100/sso</property>
<property name="hibernate.connection.username">sso_user</property>
<property name="hibernate.default_catalog">sso</property>
<property name="hibernate.default_schema">dbo</property>
<property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
</session-factory>
</hibernate-configuration>




Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 5:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you talk about "artifact generator" which is the *oold* name for our code generation - I think you should try and update ;)

If that doesn't help at least show the stacktrace.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 8:36 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
max wrote:
you talk about "artifact generator" which is the *oold* name for our code generation - I think you should try and update ;)

If that doesn't help at least show the stacktrace.


It's the name I give which is old,but I'm running the plugins which are shipped with jboss Ide 1.6

The stacktrace tells me the about problem while reading metadata. The user that I've defined have the required rights.
When I try hibernate synchronizer (which is another tools) the generation works perfectly.

I've spend one day trying to resolve this. By reading the docs, all seems simple ...

I really don't understand.

Meissa


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 8:47 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
meissa wrote:
max wrote:
you talk about "artifact generator" which is the *oold* name for our code generation - I think you should try and update ;)

If that doesn't help at least show the stacktrace.


It's the name I give which is old,but I'm running the plugins which are shipped with jboss Ide 1.6

The stacktrace tells me the about problem while reading metadata. The user that I've defined have the required rights.
When I try hibernate synchronizer (which is another tools) the generation works perfectly.

I've spend one day trying to resolve this. By reading the docs, all seems simple ...

I really don't understand.

Meissa


I've forgot to note the complete error message. It complains about creating table. I don't know why the reverse ingennering needs to create table. Even though the user I've set has the right to.
I'm using sybase db.

Meissa


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 2:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you still haven't shown the stacktrace, but now you at least mention what db you are running with.

sybase db and/or drivers gives this weird create table error when trying to read database metadata during a transaction.

enable hibernate.connection.autocommit in your cfg.xml/hibernate.properties to avoid this problem in sybase.

But do note you should only set that flag when using the tools, not when you use hibernate.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 2:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. a quick search in this forum or even google would have given you more than enough to quickly find out what the problem was...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Nightmare over
PostPosted: Wed Nov 15, 2006 7:18 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
max wrote:
you still haven't shown the stacktrace, but now you at least mention what db you are running with.

sybase db and/or drivers gives this weird create table error when trying to read database metadata during a transaction.

enable hibernate.connection.autocommit in your cfg.xml/hibernate.properties to avoid this problem in sybase.

But do note you should only set that flag when using the tools, not when you use hibernate.



I've found the solution in your http://www.hibernate.org/383.html note.
I've set the "hibernate.connection.autocommit" property to true as suggested.


The reverse works fine rignt now.

thank you a lot for your note.

Meissa


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