Bug 54 : Ebean.refresh() needs to run in its own 'persistence context'
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
1.0.2
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
11/01/2009
Updated 
11/01/2009
Type 
Bug
 
Attachments 
No attachments

See also Bug 53.

If you have a transaction spanning a Ebean.refresh() the refresh() runs in the current transactions 'persistence context'.

A refresh always needs to run in its own context to ensure that it gets fresh data from the database rather than already loaded data from the current transactions persistence context.

 
Rob 11 Jan 08:56
Fixed in v1.0.2

The fix is to internally enable a query to run with an explicitly specify context. The query used by a Ebean.refresh() has its own 'persistence context' explicitly specified... thus getting fresh data from the database.

You would not see this bug if you run Ebean.refresh() outside a transaction or when the transaction was not used to load the original bean that is being refreshed.

woResponse

Upload a file