-->
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.  [ 6 posts ] 
Author Message
 Post subject: cant call Hibernate from my own JMX
PostPosted: Wed Nov 17, 2004 6:54 am 
Beginner
Beginner

Joined: Tue Oct 26, 2004 12:45 pm
Posts: 43
Location: Israel
Hibernate version: 2.1.6

I use MSSQL

I use JBoss 3.2.5

Hi.
I loaded Hibernate as a JMX inside JBoss, works great.
The Hibernate JMX uses a Datasource and JTA.

I want to call Hibernate from within my own JMX (another JMX which uses the SessionFactory the Hibernate JMX binds).

The problem is that i can't use ANY id generation strategy!

sequence - isn't supported by sql-server
regular HiLo - doesn't work with JTA.
Session Bean - isn't loaded before the JMX (couldn't find how to make my JMX depend on that EJB, or any EJB for that matter).

My only solution this far is not to use Datasource at all (the fact that I use datasource makes it already use container managed transactions).

can someone help me please?
Issahar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 6:59 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Whats wrong with Identity?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: calling Hibernate from my own JMX
PostPosted: Wed Nov 17, 2004 7:07 am 
Beginner
Beginner

Joined: Tue Oct 26, 2004 12:45 pm
Posts: 43
Location: Israel
First, I am amazed by the very quick reply - you guys are great!


christian wrote:
Whats wrong with Identity?


I am programming for several databases, and Oracle doesn't support Identity (as far as I know).

Also, should i defind the table to use and Identity column, or the Hibernate does it by itself?

thanx again,
Issahar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 7:08 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You want "native", see the documentation.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 9:05 am 
Beginner
Beginner

Joined: Tue Oct 26, 2004 12:45 pm
Posts: 43
Location: Israel
christian wrote:
You want "native", see the documentation.


Hi.
Thank you very much for your replies.

I knew the "native", and even the "identity", and read the manual very carefuly before posting. Those options were my last.

Sorry for bothering again, but...
To avoide the mismatch between the different databases, we designed here an IDGenerator that uses a table (it is also a Session Bean, and a JMX). The JMX is bundled in the same transaction, thus it fails, and the EJB is not loaded before the JMX.

Is there any other way, or am I at a dead-end?

Thanx again for the help,
Issahar.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 10:00 am 
Beginner
Beginner

Joined: Tue Oct 26, 2004 12:45 pm
Posts: 43
Location: Israel
Issahar wrote:
Is there any other way, or am I at a dead-end?


After lots of debugging, I think we have a solution:

We created a JDBCHiLoGenerator - it works exactly as the TableHiLoGenerator (I copy/pasted the code from there), but I open a JDBC connection, instead of getting it from the DataSource.

It works, so I am happy :)

Issahar.


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