I am using hibernate 2.1 for saving a class in database. The class contains many-to-one mapping with another class. I update the existing instance if the class already exists in database. Right now after flushing after each seesion.save or session.update. This is taking a lot of time. Is there any way to optimize it. How can I use batching?
posted 11 years ago
You probably don't need to explicitly call flush(). Hibernate will do this for you when you commit your transaction.