I am using DAO class to persist/save/update the data in entity table.For this I iterate the list of objects and then get the the entity table(Task Queue) id from database if it exist then update its record in database.
I am using this code to update the record in database..
EDIT
public void saveobj(ObjectMetadata om){
taskQueue = taskQueueDAO.getTaskQueueId(om.getId());
taskQueue.setLob_compression_status("completed");
taskQueue.setEnd_time(LocalDateTime.now());
taskQueueDAO.saveOrUpdate(taskQueue);
taskQueueDAO.getEm().flush();
taskQueueDAO.getEm().clear();
taskQueueDAO.close();
}
public static someMethod( ){
for (ObjectMetadata om : oms) {
otherclass.saveobj(om);
}
}
By this code the objects are not update one by one in database. when the for loop ends completely then all entries are update at one time in database.
I want to update the entry one by one when saveorupdate function is call.What can I do for this?