Bug 53 : Finding the same bean twice in a single transaction returns null
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

Ebean.beginTransaction();
try {
Bug b0 = Ebean.find(Bug.class, 1);
// b1 is null???
Bug b1 = Ebean.find(Bug.class, 1);
} finally {
Ebean.endTransaction();
}

 
Rob 11 Jan 08:47
Also same bug... Ebean.refresh() throws ... javax.persistence.PersistenceException: Bean not found during lazy load or refresh.

Ebean.refresh() throws ...

javax.persistence.PersistenceException: Bean not found during lazy load or refresh.

Ebean.beginTransaction();
try {
Bug b0 = Ebean.find(Bug.class, 1);

// this refresh throws a PersistenceException
Ebean.refresh(b0);
} finally {
Ebean.endTransaction();
}

Rob 11 Jan 08:49
Bug in SqlTreeNodeBean

In com.avaje.ebean.server.query.SqlTreeNodeBean

The load() method returns the localBean and should return the contextBean.

// return the contextBean which is either the localBean
// read from the resultSet and put into the context OR
// the 'matching' bean that already existed in the context
postLoad(ctx, contextBean, id);

Rob 11 Jan 08:50
Fixed in v1.0.2

Fixed in v1.0.2

Note: That I'm logging a related bug 54, where the Ebean.refresh() runs in the wrong 'persistence context' (it needs to run in its own 'persistence context'.

woResponse

Upload a file