Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] find after persist is not finding persisted value

How is your Id assigned?  Is it using an IDENTITY GeneratedValue?  If so then
it cannot be assigned an Id on persist(), only on flush, so doing a find()
using its null Id will not find the object.

Either call flush(), or switch to using a TABLE or SEQUENCE GeneratedValue,
it is much more efficient anyway.


depstei2 wrote:
> 
> I was using 1.0, just tried 1.1.0 and got the same results
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/find-after-persist-is-not-finding-persisted-value-tp23041581p23059211.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top