we are using mvc-2 architecture.when i want to modify the employee details what we r doing is from controller it will goes to modifyEmployee method in sessionbean.as u can see in sessionbean code i set setEmployeeMaster(employeeMaster) inturn it will call setEmployeeMaster in Entity bean where i am making isDirtyFlag is true;we r using EJB1.1;
after that code in sessionbean i am checking whether sizes of empcharges and deptcharges tables does not equal then throw exception and total transaction should be rollback.
At the time of retrieving the count of two tables even data is not inserted in two tables in ejbStore() because ejbStore will be called by the container;after executing full modifyEmployee() method only container is calling ejbStore where i am inserting data in two tables;before transaction is commit conatiner is calling ejbStore();
my requirment is i have to check whether in two tables any mismatch is going ;
how can i write this in this type of scenario?but while creating employee details i have put same condition where ejbCreate will be called at that time transaction is rolledback.(when i say home = (EmployeeEntityHome)ictx.lookup("EmployeeEntityBean"); remote = (EmployeeEntity)home.create(); container is calling immediately ejbCreate);
but in this case container is not calling immediately ejbStore when i say remote.setEmployeeMaster(employeeMaster);
i have written Pseudo code may be some errors are there;i am using JBoss