public class ServerLocalTransaction extends java.lang.Object implements ServerLocalTransactionI
| Modifier and Type | Method and Description |
|---|---|
void |
close()
cleans up this server-side-only transaction and the attached PersistenceHandler
|
void |
close(boolean $throw) |
void |
closeNT()
Closes this ServerLocalTransactionI, relinquishing any underlying resources,
logging errors only instead of throwing them.
|
Transaction |
getTransaction()
Returns the underlying Transaction that is used for recording server local changes.
|
boolean |
isClosed()
Returns true if this ServerLocalTransaction is closed and thus not usable anymore.
|
static ServerLocalTransaction |
of(DBManLocalI _dbman,
Benutzer _user,
BackendSessionI _session,
java.lang.String _desc,
int _lockTimeout,
TemporaryIdSupplierI _temporaryIdSupplier,
boolean _withInstrumentedSchema,
boolean _intendedForSaving)
Returns a container with the
PersistenceHandlerI and an instance of Transaction
with a BOLoaderI which is prepared for saving on server-side, as the PersistenceHandler and the loader
are set to shared lockmode. |
TransactionAnswer |
saveBO(Benutzer saveAs)
Persists the changes recorded in this ServerLocalTransactionI to the database.
|
void |
saveBOWithoutLogs(Benutzer saveAs)
Persists the changes recorded in this ServerLocalTransactionI to the database,
but does not record the changes via BT/BP logs.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsaveBO, saveBOWithoutLogspublic static ServerLocalTransaction of(DBManLocalI _dbman, Benutzer _user, BackendSessionI _session, java.lang.String _desc, int _lockTimeout, TemporaryIdSupplierI _temporaryIdSupplier, boolean _withInstrumentedSchema, boolean _intendedForSaving)
PersistenceHandlerI and an instance of Transaction
with a BOLoaderI which is prepared for saving on server-side, as the PersistenceHandler and the loader
are set to shared lockmode.
That way any queried object is also usable for persisting modifications on the server-side.
Retries are not supported, as a failed save is broken and can and must not be retried.
You need to recreate the Transaction and try saving again with a fresh ServerLocalTransactionI.
It is discouraged to retry saving the same procs again, as they were based on outdated data.
Simply saving those procs would probably be wrong, as operating on a different state will most
probably yield a different result to save. So it is much better and safer to operate on the
obviously modified new database state. Thus the core does not support retries and you need
to care for that in your own code._dbman - the underlying DBManLocalI to use_user - the Benutzer to save on behalf of_session - the relevant BackendSessionI of the passed Benutzer;
if null is passed, the "current" session will be used (determined via thread local)
FIXME TH 2024-04-24: do we ever want to pass an explicit session here or shouldn't we rather always take the current one?
FIXME TH 2024-04-24: it is not yet decided if the _user shall also be defaulted via the session_desc - the description to use in the contained Transaction within the ServerLocalTransactionI_lockTimeout - time to wait in seconds until a locking error is reported in case some
object is already locked by another thread; defaults to -1.
Zero or less for no waiting, i.e. immediate timeout (or rather the defined lock-timeout
of JDO, which defaults to 30s), an infinite value for no timeout._temporaryIdSupplier - a TemporaryIdSupplier supplying temporary Ids
for our Transaction; if null is passed, the determined session to use will be used instead,
if that is null as well, the Transaction will manage that on its own_withInstrumentedSchema - if true, the DBManLoaderI's SchemaI will be passed to the newly created Transaction wrapped as an InstrumentingSchema_intendedForSaving - if true, a PersistenceHandlerI for saving will be acquired from the passed DBManLocalI,
otherwise only loading objects will be supportedpublic Transaction getTransaction()
ServerLocalTransactionIgetTransaction in interface ServerLocalTransactionIpublic TransactionAnswer saveBO(Benutzer saveAs)
ServerLocalTransactionIsaveBO in interface ServerLocalTransactionIsaveAs - the Benutzer to save on behalf ofpublic void saveBOWithoutLogs(Benutzer saveAs)
ServerLocalTransactionIsaveBOWithoutLogs in interface ServerLocalTransactionIsaveAs - the Benutzer to save on behalf ofpublic boolean isClosed()
ServerLocalTransactionIisClosed in interface ServerLocalTransactionIpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic void close(boolean $throw)
throws java.lang.Exception
java.lang.Exceptionpublic void closeNT()
ServerLocalTransactionIcloseNT in interface ServerLocalTransactionICopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.