openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi P Palacherla <ravi.palache...@oracle.com>
Subject Re: insertable/updatable = false question
Date Thu, 13 Aug 2009 23:46:00 GMT

Hi,

I think I found a better solution.

after flush() 
call em.refresh(e2)
This will refresh the state of e2 from the datastore. 

now e2.gete1() should return NON-NULL value.

Previously, it was not working because even though flush() updates the
datastore with values of e2.
The next call e2.gete1() is not going to datastore but using the e2's state
in the persistenceContext.

Please try and let me know if it has any issues.

Regards,
Ravi.


ljnelson wrote:
> 
> On Thu, Aug 13, 2009 at 4:39 PM, Ravi P Palacherla (via Nabble) <
> ml-user+194843-327306094@n2.nabble.com<ml-user%2B194843-327306094@n2.nabble.com>
>> wrote:
> 
>> Hi Laird,
>>
>> I also think that you should get a NON-NULL for e2.gete1() after flush,
>> provided e2 is managed at the time you are doing e2.gete1().
>>
> 
> Interestingly enough, I have run this using all the persistence providers,
> and they all give me NULL.  I just can't see reading the spec that way,
> but
> everyone has, I guess.
> 
> Let me try your suggestion.
> 
> Thanks,
> Laird
> 
> 

-- 
View this message in context: http://n2.nabble.com/insertable-updatable-%3D-false-question-tp3439111p3441686.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message