It seems like sometimes this method just will not save the data to the database, which can be very frustrating. I'll list some common causes and remedies below:
1) Toplink will not update values that compose the key pf an object. The only way I know around this is to delete the old object and create a new one.
2) You are calling mergeEntity() against objects created by a ReadAllQuery. In this case, in your session facade bean method you should make sure that you uncomment the code that detaches the results. It will be directly below a couple of comments that should look like these:
// Uncomment the following lines of code if the results from this query will be mutated.
// See SessionFactory.detach() for more information.
3) The read and the merge are using different transactions. Change the code to use the same transaction for reading/updating.
No comments:
Post a Comment