-
Apr 28th, 2008, 02:23 AM
#1
Need info on PROPGATION_REQUIRED transactions
Here are few observations related to problem i am facing.
Transaction atttributes defined for Service class.
-----------------------------------------------------
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="submit*">PROPAGATION_REQUIRED</prop>
</props>
</property>
----------------------------------------------------------
here is the service method:
public void saveEmployeeDetails(Employee employee, Department department) {
saveEmployee(employee);
if (employee.getId() != null) {
saveDepartment(department, employee.getId());
}
}
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..
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules