Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Flush before (ReadAll-)Query

Hi,

within an active transaction, I try to execute a ReadAllQuery this way:
Session session = JpaHelper.getEntityManager(persistenceContext).getActiveSession();
ReadAllQuery query = new ReadAllQuery();
query.setReferenceClass(referenceClass);
//...
result = session.executeQuery(query);
When there are uncommited changes within the transaction, those changes are not flushed automatically to the database. So, the query will not find these "uncommited" objects.

What am I to do to let the query also find these uncommited changes? Do I have to call EntiyManager#flush() explicitly or is there a switch to turn on some sort of FLUSHMODETYPE.AUTO as defined in JPA?

Kind regards,
Frank



Message re-sent.

View this message in context: Flush before (ReadAll-)Query
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

Back to the top