Hi,
I want use hibernate transaction ..any body please explain me how to use Hibernate Transaction in proper way.
Here is my scenario :
I have 3 tables i.e user ,address ,and account tables.And every table having its own POJO if user logged into my site i have to update the above 3 tables.
step 1 .Once user logged in i have to update the user status in side user table step 2.then update the his address details which are inside address table. step 3. finally update his account details based on user table status .
if any step is failed Transaction has to be roll back ..
for each step i have implemented logic in different methods i.e updateUser(string puserId) ,updateAddress(String pUserId) ,updateAccount(String pAccountId) .
I'm calling these three methods inside my main method i.e updateUserInfo(){
updateUser(string puserId) ; updateAddress(String pUserId) ; updateAccount(String pAccountId) ; }
Thanks, Malli.
|