-->
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.  [ 5 posts ] 
Author Message
 Post subject: hilo generator and "supplying your own connection"
PostPosted: Tue Jan 03, 2006 3:46 pm 
Beginner
Beginner

Joined: Wed Mar 16, 2005 4:07 pm
Posts: 22
hi all,

i would like to use seqhilo to generate id with hibernate 3.0. the document says the following:

Unfortunately, you can't use hilo when supplying your own Connection to Hibernate. When Hibernate is using an application server datasource to obtain connections enlisted with JTA, you must properly configure the hibernate.transaction.manager_lookup_class.

i am not sure what it means by "supplying your own connection". i am using spring to set up a dbcp datasource and then use spring's LocalSessionFactoryBean and HibernateTransactionManager to set up transaction interceptors. i guess i am not using jta in this case. nor am i using any jndi datasource. would it count as "supplying your own connection"? can someone enlighten me on this?

thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 9:07 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
seqhilo is not hilo, this restriction does not apply

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 10:48 am 
Beginner
Beginner

Joined: Wed Mar 16, 2005 4:07 pm
Posts: 22
thanks for the reply. my bad, didn't notice the constraint on "hilo" only.

still curious, what exactly does "supply your own transaction" mean? and why is that a constraint for hilo generator?

many thanks.

emmanuel wrote:
seqhilo is not hilo, this restriction does not apply


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 11:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
If you are using a Connection pool you are not supplying your own connections. This only applies if you use SessionFactory.openSession(connection) or the like.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 08, 2006 6:49 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
[quote="weiqingh"]thanks for the reply. my bad, didn't notice the constraint on "hilo" only.

still curious, what exactly does "supply your own transaction" mean? and why is that a constraint for hilo generator?

/quote]

Hibernate needs a separate Transaction(and hence use some connection) to get the next hi value from a Hilo table and use that as the identifier for your entity. if you are supplying Connections(and hence not fed through a Connection pool), Hibernate would not be able to get any connections in this case.


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