public class Transaction.Savepoint
extends java.lang.Object
implements de.ipcon.db.core.BOProcHolderI
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits the changes made within this savepoint and merges all properties associated with this savepoint
into its predecessor, or into the parent transaction, if no predecessor exists.
|
void |
dumpProcs(org.apache.log4j.Logger _log) |
void |
dumpProcs(org.apache.log4j.Logger _log,
org.apache.log4j.Level _level) |
java.util.Map<java.lang.String,de.ipcon.db.core.Transaction.TransactionLocal> |
getAllLocals() |
TransactionCanonification |
getCanonification(boolean modifyCurrent)
Generates a canonized version of the transaction, starting from this savepoint.
|
int |
getDeletedBOCount() |
int |
getIncludedBOCount() |
BO[] |
getIncludedBOs() |
java.lang.String |
getName()
Retrieves the name associated with this savepoint.
|
int |
getNewBOCount() |
java.lang.Object |
getOwner()
Retrieves the owner associated with this savepoint.
|
int |
getProcCount() |
java.util.List<BOProc> |
getProcs() |
java.lang.Object |
getProperty(java.lang.String s)
Retrieves a property value, searching within this savepoint, previous savepoints, and the enclosing transaction.
|
int |
getPurgedBOCount() |
java.util.Map<java.lang.String,de.ipcon.db.core.Transaction.TransactionLocal> |
getSpLocals()
Returns an unmodifiable map of the current properties (transaction locals) within this savepoint.
|
Transaction |
getTransaction()
returns Transaction associated with this Savepoint
|
boolean |
hasCanonizedProcs() |
boolean |
hasInteractiveProcs() |
boolean |
hasNonInteractiveProcs() |
boolean |
hasProcs() |
boolean |
hasProperty(java.lang.String key)
Checks if a transaction property with the given key is present.
|
boolean |
isActive()
Checks if any changes (procedures) have been recorded in the transaction after this savepoint was created.
|
boolean |
isValid()
Checks if this savepoint is still valid.
|
java.lang.String |
newBOsToString()
Converts the new BOs within this savepoint to a human-readable string representation.
|
java.lang.String |
newBOsToString(boolean _html) |
java.lang.String |
procsToString()
Converts the procedures of the parent transaction that are captured within this savepoint to a human-readable string representation.
|
java.lang.String |
procsToString(boolean html) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped,
boolean canonize) |
java.lang.String |
procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped,
boolean canonize,
boolean skipBackProcs) |
java.lang.String |
procsToString(TransactionFormatterBuilder builder) |
void |
rollback()
Rolls back the associated transaction to this savepoint, undoing all changes made after it.
|
void |
setProperty(java.lang.String s,
java.lang.Object v,
byte scope)
Sets or updates a property within this savepoint, potentially shadowing properties in previous
savepoints or the enclosing transaction.
|
void |
setProperty(java.lang.String s,
java.lang.Object v,
byte scope,
boolean isFinal) |
public boolean isValid()
A savepoint becomes invalid if either:
true if the savepoint is still valid, false otherwise.public Transaction getTransaction()
Transactionpublic int getNewBOCount()
getNewBOCount in interface de.ipcon.db.core.BOProcHolderIpublic int getPurgedBOCount()
public int getDeletedBOCount()
getDeletedBOCount in interface de.ipcon.db.core.BOProcHolderIpublic java.lang.String newBOsToString()
public java.lang.String newBOsToString(boolean _html)
newBOsToString in interface de.ipcon.db.core.BOProcHolderIpublic int getProcCount()
public int getIncludedBOCount()
public BO[] getIncludedBOs()
public TransactionCanonification getCanonification(boolean modifyCurrent)
This method creates a `TransactionCanonification` object that analyzes and optimizes the transaction's changes (BOProcs) from this savepoint onwards. It removes redundant or overwritten changes, resulting in a more efficient representation of the transaction's impact.
modifyCurrent - parameter is unused, probably to assure a consistent APIpublic void rollback()
This operation also reverts any savepoints created after this one and undoes the include operation on any objects that were exclusively included within this savepoint's scope. Thus, after the rollback, changes to these objects will no longer be tracked unless they are explicitly included again.
public void commit()
Committing this savepoint also automatically commits any nested savepoints created after this one.
isValid()public java.util.List<BOProc> getProcs()
public boolean hasProcs()
hasProcs in interface de.ipcon.db.core.BOProcHolderIpublic boolean hasCanonizedProcs()
hasCanonizedProcs in interface de.ipcon.db.core.BOProcHolderIpublic boolean hasInteractiveProcs()
hasInteractiveProcs in interface de.ipcon.db.core.BOProcHolderIpublic boolean hasNonInteractiveProcs()
hasNonInteractiveProcs in interface de.ipcon.db.core.BOProcHolderIpublic boolean isActive()
This method determines if any modifications to existing BOs or relationships have occurred after this savepoint. It does not consider the creation of new BOs without subsequent changes as an active change.
false otherwise.Transaction.isActive()public java.lang.String getName()
This name was originally provided when creating the savepoint using the
Transaction.savepoint(String) method.
public java.lang.Object getOwner()
The owner is an arbitrary object that was optionally provided when creating the savepoint using
the Transaction.savepoint(String, Object) method. It can be used to identify the context or
purpose of the savepoint and may be used in owner-oriented API calls.
public java.util.Map<java.lang.String,de.ipcon.db.core.Transaction.TransactionLocal> getSpLocals()
These properties represent variables and their values that are local to the scope of this savepoint. The returned map provides a read-only view, ensuring that the properties cannot be modified externally.
public boolean hasProperty(java.lang.String key)
This method determines whether a property with the specified key exists within the transaction's internal property map. It's useful for verifying the presence of a specific property before attempting to access its value.
key - The key of the transaction property to check for.true if a property with the given key exists, false otherwise.public java.lang.Object getProperty(java.lang.String s)
This method first attempts to find the property within this savepoint's local properties. If not found, it recursively searches through previous savepoints, and finally, the enclosing transaction. This allows for hierarchical property lookup within nested savepoints.
s - The name of the property to retrieve.Transaction.getProperty(String)public void setProperty(java.lang.String s,
java.lang.Object v,
byte scope)
This method allows you to store a property value associated with the current savepoint. If a property with the same key already exists in a previous savepoint or the enclosing transaction, it will be shadowed by the new value set in this savepoint.
If you need finer control over property scoping and want to avoid shadowing, consider using
Transaction.setProperty(String, Object, byte) instead.
s - The key (name) of the property.v - The value to associate with the property.scope - The scope of the property, indicating its visibility and lifetime.
See Transaction.PROPERTY_SCOPE_COMMIT, Transaction.PROPERTY_SCOPE_SERVER,
and Transaction.PROPERTY_SCOPE_TRANSACTION for possible values.isFinal - If true, the property is marked as final and cannot be modified further.Transaction.setProperty(String, Object, byte),
Transaction.PROPERTY_SCOPE_COMMIT,
Transaction.PROPERTY_SCOPE_SERVER,
Transaction.PROPERTY_SCOPE_TRANSACTIONpublic void setProperty(java.lang.String s,
java.lang.Object v,
byte scope,
boolean isFinal)
public java.util.Map<java.lang.String,de.ipcon.db.core.Transaction.TransactionLocal> getAllLocals()
public void dumpProcs(org.apache.log4j.Logger _log)
dumpProcs in interface de.ipcon.db.core.BOProcHolderIpublic void dumpProcs(org.apache.log4j.Logger _log,
org.apache.log4j.Level _level)
public java.lang.String procsToString(TransactionFormatterBuilder builder)
procsToString in interface de.ipcon.db.core.BOProcHolderIpublic java.lang.String procsToString()
html - Whether to format the output as HTML or plain text.onlyThisBO - If not null, only BOProcs affecting this BO will be included in the output.limitToExplicitBO - If false, all procs are being printed even when the onlyThisBO is not null.maxProcs - Number of procs that are to be printed (exclusive). A value of -1 is equivalent to getProcs().size().grouped - Whether the procs should be formatted to be grouped by the BO they are concerning or not.canonize - Whether the procs of this savepoint are to be canonized Transaction.canonize(boolean).skipBackProcs - Whether to skip "redundant" procs setting only back relations from the output. Only makes sense if
canonize is passed as true as well.public java.lang.String procsToString(boolean html)
public java.lang.String procsToString(boolean html,
BO onlyThisBO)
public java.lang.String procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO)
public java.lang.String procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs)
public java.lang.String procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped)
public java.lang.String procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped,
boolean canonize)
public java.lang.String procsToString(boolean html,
BO onlyThisBO,
boolean limitToExplicitBO,
int maxProcs,
boolean grouped,
boolean canonize,
boolean skipBackProcs)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.