-->
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: does CaveatEmptor violate j2ee spec ?!
PostPosted: Thu Aug 19, 2004 3:42 am 
Beginner
Beginner

Joined: Wed Feb 11, 2004 6:08 am
Posts: 29
Location: Germany
Hi,

the CaveatEmptor app (v0.9.5) uses a servlet filter in order to demarcate transaction boundaries (HibernateUtil.commitTransaction()). As far as I understand the j2ee spec, this is not allowed in case of JTA.

j2ee spec [1] says: "Servlet filters and web application event listners must not demarcate transactions using the javax.transaction.UserTransaction interface. Servlet filters may use transactional resources in a local transaction mode within their doFilter methods but should not use any transactional resources in the methods of any object used to wrap the request or response object."

Do I misunderstand something?!




[1] J2EE specification 1.4, chapter 4.2.1, pp. 47 (and J2EE 1.3 as well)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 3:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are correct. However, this does work on all platforms ;-)


Top
 Profile  
 
 Post subject: Better solution?
PostPosted: Thu Dec 09, 2004 7:08 pm 
Beginner
Beginner

Joined: Thu Dec 09, 2004 7:04 pm
Posts: 26
Location: Denver, CO
What about using a filter only to create and close the session and creating a transaction in a base struts action?

This would:

Have the session available for filling in lazy data for the jsp page

Have the transaction commited or not in the business layer

Not violate the spec?


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.