Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

attempt to create saveOrUpdate event with null entity

I have a GWT app that makes an RPC call to a server to save/create a new entity. However, the Spring-Hibernate back-end throws an exception with the following error message:

attempt to create saveOrUpdate event with null entity

I'm not sure what that means. What's null? If it's a new entity I am saving, I am expecting to have the id field be null or possibly 0, and then have hibernate fill it. Is this expectation correct?

like image 511
Rafael Avatar asked Sep 04 '09 12:09

Rafael


1 Answers

null entity could mean that saveOrUpdate() is actually receiving null as an argument, ie:

session.saveOrUpdate(null);

If you're using serialization to pass to object to a remote location (you mentioned RPC), perhaps you should check if serialization is working correctly. Something tells me that failing to serialize might end up with a null reference being passed.

like image 70
André Chalella Avatar answered Sep 23 '22 03:09

André Chalella