-->
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.  [ 2 posts ] 
Author Message
 Post subject: Need info on PROPGATION_REQUIRED behavior
PostPosted: Mon Apr 28, 2008 12:42 am 
Newbie

Joined: Thu Feb 28, 2008 12:35 pm
Posts: 15
Hi,

I need info on the hibernate transactions with PROPGATION_REQUIRED.

Lets say i configured my service class with

<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="submit*">PROPAGATION_REQUIRED</prop>
</props>
</property>

As far as i understood, the above lines will inject transactions for methods whose names start with save/delete/submit.

I want to know if i have a method like this:

submitEmployeeDetails() {
//some code goes here
saveDepartmentDetails();
//rest of code goes here
}


whether both the above methods will be part of single transaction or not.

Thanks in advance,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 28, 2008 3:17 am 
Newbie

Joined: Thu Feb 28, 2008 12:35 pm
Posts: 15
Here are few more observations related to problem i am facing.

In addition to the transaction definition as given earlier, here is the workflow

1. User enters employee details on the screen
2. User enters Department details in a popup on the screen.
3. employees details get saved using saveEmployeeDetails() method
4. after step 3, using the id generated for employee in step 3, i just invoke saveDepartment details.

Note: i am not saving the relationship, just simple call of saveorupdate(department).

5. once i re-query for the employee in the same HTTP request, the department details appear null. i.e., employee.getDepartmentDetails() ==> null

6. But if i re-query in different Http request, i am able to fetch the department details.

Can somebody please help me, what exactly is wrong here..


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