|
Hello that such:
I have the following case,
I do a query to the table1 and gives me 41 data stored in a List1
Iterate list1 to make another query to table2 and 23 994 data stored in a List2
Iterate list2 and for each record that meets certain conditions you do your Session.save
I can not have a single query in both general and conditions that need to happen to come from my gui
after all validations then I do the commit
protected void saveStatus (String status, Session sess) ( Transaction tx = null; try ( tx = sess.getTransaction (); tx.begin (); processStatus.setStatus (status); processStatus.setEndProcess (new Date ()); sess.saveOrUpdate (ProcessStatus) tx.commit (); ) catch (Exception ex) ( if (tx! = null & & tx.isActive ()) tx.rollback (); ) )
as I can improve my performance? and is very slow and takes days
|