public void flush();
flush method writes any changes that have been made
in the current transaction to the datastore. If the
does not already have a connection to the datastore, it obtains one
for the flush and retains it for the duration of the transaction. Any exceptions
during flush cause the transaction to be marked for rollback. See
Flushing requires an active transaction. If there isn't a transaction in
flush method throws a
public FlushModeType getFlushMode(); public void setFlushMode(FlushModeType flushMode);
controls whether to flush transactional changes before executing queries. This
allows the query results to take into account changes you have made during the
current transaction. Available
javax.persistence.FlushModeType constants are:
COMMIT: Only flush when committing, or when told to do so
flush method. Query results may not take
into account changes made in the current transaction.
AUTO: The implementation is permitted to flush before
queries to ensure that the results reflect the most recent object state.
You can also set the flush mode on individual
OpenJPA only flushes before a query if the query might be affected by data changed in the current transaction. Additionally, OpenJPA allows fine-grained control over flushing behavior. See the Reference Guide's Section 8, “ Configuring the Use of JDBC Connections ”.
public void clear();