-->
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.  [ 3 posts ] 
Author Message
 Post subject: JTA / JBOSS CMT question
PostPosted: Sun Sep 14, 2003 2:50 pm 
Newbie

Joined: Sun Sep 14, 2003 2:15 pm
Posts: 4
Platform: Hibernate 2.1 / JBOSS 3.2.2

1) Why must an EJB with CMT be marked as "Required" in order to do a session.load? Supports has always worked for JDBC datasources - for "read" use cases.

2) When I do this in a CMT session bean with required...

Session session = null;
Session session2 = null;
try
{
ctx = new InitialContext();
SessionFactory sessionFactory =
(SessionFactory)ctx.lookup("java:/hibernate/HibernateFactory");
session = sessionFactory.openSession();
session2 = sessionFactory.openSession();
MyObjectWithEqualsImpl obj = session.load .....
MyObjectWithEqualsImpl obj2 = session2.load ...
if (! obj.equals( obj2))
throw new SessionsAreNotEQualIDoNotUnderStandException();

why is this a failure?? Certainly these means loading deep object graphs will not work very well - the whole point of going with hibernate (for me) in the first place.

3) The javadocs show a package for net.sf.hibernate.jca. What is the significance of this package in terms of using Hibernate as a service in JBOSS?

4) If I want to also use JMS in EJB methods - will Hibernate factory play nicely in a XA transaction?

Thanks,
Joel Stewart


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2003 2:53 pm 
Newbie

Joined: Sun Sep 14, 2003 2:15 pm
Posts: 4
correction, on question 2, the .equals() DOES work (of course) but the == operator does not work.

Sorry about the confusion.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2003 5:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
1) Hibernate uses callbacks from the transaction manager for dealing wth the cache management issues, eg, hibernate.transaction.manager_lookup_class which is needed when JVM-level caching is enabled in a JTA environment.

2) Session effectively operated in its own world and contains its own cache of objects (session level cache) thus the instances are not shared across sessions.

3) Hibernate can be created several ways in JBoss.
o The servlet level.
o The EJB Level via either MBeans (as the examples in the docs show)
or by using a standard JCA container. JCA advantage is that you can
use it for other application servers.

4) Yes.


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