Top Description Fields Constructors Methods
org.apache.derby.impl.store.raw.xact

public Class BeginXact

extends Object
implements Loggable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.raw.Loggable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Imports
org.apache.derby.iapi.services.io.FormatIdUtil, .StoredFormatIds, .LimitObjectInput, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.store.raw.Transaction, .Loggable, .GlobalTransactionId, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.iapi.store.raw.xact.RawTransaction, org.apache.derby.iapi.util.ByteArray, java.io.OutputStream, .InputStream, .ObjectOutput, .ObjectInput, .IOException

This operation indicates the beginning of a transaction.
See Also
Loggable

Field Summary

Modifier and TypeField and Description
protected int
protected GlobalTransactionId

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
doMe(Transaction
the Transaction
xact
,
LogInstant
the log instant of this operation
instant
,
LimitObjectInput
optional data
in
)

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Apply the change indicated by this operation and optional data.

public GlobalTransactionId
getGlobalId()

BeginXact method

public ByteArray
getPreparedLog()

Implements org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

the default for prepared log is always null for all the operations that don't have optionalData.

public int
public int
group()

Implements org.apache.derby.iapi.store.raw.Loggable.group.

BeginXact is both a FIRST and a RAWSTORE log record

public boolean

Returns:

true if operation needs redoing, false if not.
needsRedo
(Transaction
The transaction trying to redo this operation
xact
)

Implements org.apache.derby.iapi.store.raw.Loggable.needsRedo.

Always redo a BeginXact.

public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public void
releaseResource(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

BeginXact has no resource to release

public String
toString()

Overrides java.lang.Object.toString.

DEBUG: Print self.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

transactionStatusback to summary
protected int transactionStatus
xactIdback to summary
protected GlobalTransactionId xactId

Constructor Detail

BeginXactback to summary
public BeginXact(GlobalTransactionId xid, int s)
BeginXactback to summary
public BeginXact()

Method Detail

doMeback to summary
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in)

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Apply the change indicated by this operation and optional data.

Parameters
xact:Transaction

the Transaction

instant:LogInstant

the log instant of this operation

in:LimitObjectInput

optional data

getGlobalIdback to summary
public GlobalTransactionId getGlobalId()

BeginXact method

getPreparedLogback to summary
public ByteArray getPreparedLog()

Implements org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

the default for prepared log is always null for all the operations that don't have optionalData. If an operation has optional data, the operation need to prepare the optional data for this method. BeginXact has no optional data to write out

See Also
ObjectOutput
getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Return my format identifier.

Returns:int

Doc from org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

The identifier. (A UUID stuffed in an array of 16 bytes).

groupback to summary
public int group()

Implements org.apache.derby.iapi.store.raw.Loggable.group.

BeginXact is both a FIRST and a RAWSTORE log record

needsRedoback to summary
public boolean needsRedo(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.needsRedo.

Always redo a BeginXact.

Parameters
xact:Transaction

The transaction trying to redo this operation

Returns:boolean

true if operation needs redoing, false if not.

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

the stream to read data from in order to restore the object

Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
releaseResourceback to summary
public void releaseResource(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

BeginXact has no resource to release

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

DEBUG: Print self.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

the stream to write the object to

Exceptions
IOException:
Includes any I/O exceptions that may occur