Hibernate version: 2.17
I have a POJO named EmployeeSch. In my ejb-tier I am building a java.util.Set of EmployeeSch. The semantics of this method in ejb-tier are :
Set employeeSchs = new HashSet();
try {
HibernateUtil.getSession();
HibernateUtil.beginTransaction();
...
EmployeeSch aEmployeeSch = new EmployeeSch();
...
employeeSchs.add( aEmployeeSch );
...
HibernateUtil.commitTransaction();
} catch (Exception e) {
HibernateUtil.rollbackTransaction();
}
finally {
HibernateUtil.closeSession();
}
return employeeSchs;
I am passing this Set to web-tier. Each EmployeeSch will be shown to the user as a row in the jsp. User can make changes to any of them and when save clicked, I want to save them in the database.
I am thinking about this colution:
* Save the Set in web-tier; after user has made changes, populate those changes in each of respective EmployeeSch, put them back in Set and pass the Set to ejb-tier where it will be looped and saved.
My first concern is memory; this Set potentially can have more than 100 rows. Will it be a problem?
My another concern is automatic update. I have created new EmployeeSch objects. Is it possible that they got saved by some other update on some other screen?
Thanks
|