setImplicitBehavior

Set the broker's behavior for implicit actions such as flushing,
automatic detachment, and exceptions thrown by managed instances outside
a broker operation. A broker's implicit behavior can only be set once;
after the first invocation with non-null arguments,
subsequent invocations of this method are ignored.

releaseSavepoint

Release the savepoint and any resources associated with it.
The given savepoint and any set after it will become invalid.

flush

void flush()

Flush all transactional instances to the data store. This method may
set the rollback only flag on the current transaction if it encounters
an error.

Since:

0.2.5

preFlush

void preFlush()

Run pre-flush actions on transactional objects, including
persistence-by-reachability, inverse relationship management,
deletion of dependent instances, and instance callbacks.
Transaction listeners are not invoked.

Since:

0.3.3

validateChanges

void validateChanges()

Validate the changes made in this transaction, reporting any optimistic
violations, constraint violations, etc. In a datastore transaction or
a flushed optimistic transaction, this method will act just like
flush(). In an optimistic transaction that has not yet begun a
datastore-level transaction, however, it will only report exceptions
that would occur on flush, without retaining any datastore resources.

detachAll

Detach the specified objects from the broker. The objects returned can
be manipulated and re-attached with attachAll(java.util.Collection, boolean, org.apache.openjpa.kernel.OpCallbacks). The
detached instances will be unmanaged copies of the specified parameters,
and are suitable for serialization and manipulation outside
of a OpenJPA environment. When detaching instances, only fields
in the current FetchConfiguration will be traversed. Thus,
to detach a graph of objects, relations to other persistent
instances must either be in the default-fetch-group,
or in the current custom FetchConfiguration.

attachAll

Import the specified objects into the broker. Instances that were
previously detached from this or another broker will have their
changed merged into the persistent instances. Instances that
are new will be persisted as new instances.

Parameters:

objs - array of instances to import

copyNew - whether to copy new instances

Returns:

the re-attached instances

newInstance

Create a new instance of type cls. If cls is
an interface or an abstract class whose abstract methods follow the
JavaBeans convention, this method will create a concrete implementation
according to the metadata that defines the class.
Otherwise, this will return an instance of the specified class.

dirtyType

beginOperation

boolean beginOperation(boolean syncTrans)

Begin a logical operation. This indicates to the broker the
granularity of an operation which may require pre/post operation
side-effects, such as non-tx detach.
Will lock the broker until the endOperation() is called.

Parameters:

syncTrans - whether instances may be loaded/modified during
this operation requiring a re-check of global tx

Returns:

whether this is the outermost operation on the stack

endOperation

boolean endOperation()

End a logical operation. This indicates to the broker the
granularity of an operation which may require pre/post operation
side-effects, such as non-tx detach. Unlocks the given broker.

Returns:

whether this is the outermost operation on the stack

isClosed

boolean isClosed()

Whether the broker is closed.

isCloseInvoked

boolean isCloseInvoked()

Whether close() has been invoked, though the broker might
remain open until the current managed transaction completes.