-->
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: config in managed environment (JBoss)
PostPosted: Mon Jun 13, 2005 7:31 pm 
Newbie

Joined: Tue May 31, 2005 8:19 pm
Posts: 16
Location: San Francisco, CA
just getting started out with:
jboss 4.0.2
spring 1.2
hibernate 3.0.5
sql server 7.0 (legacy!)

I just finished reading Chapter 2, Hibernte In Action. Since I am running my web app under JBoss, they that it is "necessary" to set the factory class for the Hibernate Transaction API to JTA (rather than defaulting to JDBC) --- they go on to explain that if a JTA manager is present, JDBC connections are enlisted with the manager and under its full control.

This seems a bit odd that I would be forced to use JTA rather than the JDBC transaction strategy, considering that I will not have any distributed transactions in my app. Is it absolutely true that I have to use Hiberante JTATransactionFactory since I'm using JBoss, or just highly recommended ?

If it is true, not knowing much about JTA or distributed transactions, does this mean I have to use an xa-aware data source ?

On a somewhat related note, if I run Hibernate as a JMX service in JBoss so that SessionFactory is available via JNDI, does anyone know if Spring can be configured to use a Hibernate SessionFactory that is bound to JNDI ---- because if Spring instantiates its own Configuration and SessionFactory, then there are two SessionFactory objects, one created by JMX and one created by Spring --- surely this is not what is wanted ??

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 8:50 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
If the guys who wrote Hibernate tell you something is needed it usually is.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 1:01 am 
Newbie

Joined: Tue May 31, 2005 8:19 pm
Posts: 16
Location: San Francisco, CA
Thanks Christian.

I certainly agree with you. I was just looking for some clarification, since outside of Hibernate, JTA is generally relegated to apps that have distributed transaction needs.

Also, there is some confusion, even among Hibernate's own, whether JTATransactionManager is necessary. See the page about integrating Hibernate3 with JBoss at:
http://www.hibernate.org/282.html

If you could shed some light on the line that says
"use JTATransactionFactory (we have this, but not sure if it is required)"
I would be eternally grateful.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 4:58 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the reference documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 3:28 pm 
Newbie

Joined: Tue May 31, 2005 8:19 pm
Posts: 16
Location: San Francisco, CA
Thanks Christian.

I reread the reference and can give you a clearer picture of why I am asking.

Both the reference and Hibernate In Action are unclear. They indicate that JTATransactionFactory should be used if you are running in a managed environement, where they define a managed environment as one that pools resources such as db connections and allows transaction boundaries to be specified declaritively.
- I am (JBoss)

They also indicate that JTATransactionFactory is for using JTA/CMT.
- I am not (no distributed transactions or CMT)

Hence my confusion.

Thanks for any help you can provide.

Charlie


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 4:13 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
What is unclear about this:

http://www.hibernate.org/hib_docs/v3/re ... onstrategy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 4:15 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Here is a tip: There is only BMT and CMT, nothing else. You try to find a third thing which doesn't exist. No, JTA has nothing to do with distributed transactions, though a JTA system might allow you to do distributed transactions. Maybe you should read up on some J2EE basics.


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.