goashok / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

Improve efficency of deletes #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It is probably not necessary to fetch the entity from the DB before 
deleting it.

Session.delete() will work fine with a transient instance.

Session.delete() may throw an unrecoverable error if no matching id is 
found in DB. Not sure.

EntityManager.remove() cannot take transient instance, but it may be able 
to recover if no matching id is found.

Original issue reported on code.google.com by dwolvert on 9 Apr 2009 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by dwolvert on 10 Sep 2009 at 12:12