public abstract class Lob extends Object implements UnitOfWorkListener
| Modifier and Type | Field and Description |
|---|---|
protected Agent |
agent_ |
static int |
ASCII_STREAM |
static int |
BINARY_STREAM |
static int |
BINARY_STRING |
static int |
CHARACTER_STREAM |
protected String |
columnName |
protected int |
dataType_ |
static int |
INVALID_LOCATOR |
protected boolean |
isValid_
This boolean variable indicates whether the Lob object has been
invalidated by calling free() on it
|
protected static ClientMessageId |
LOB_OBJECT_LENGTH_UNKNOWN_YET |
static int |
LOCATOR |
protected int |
locator_ |
protected CallableLocatorProcedures |
locatorProcs_ |
static int |
STRING |
static int |
UNICODE_STREAM |
| Modifier | Constructor and Description |
|---|---|
protected |
Lob(Agent agent,
boolean willBeLayerBStreamed,
String columnName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkPosAndLength(long pos,
long length)
Checks the
pos and length. |
protected void |
checkValidity()
Checks if isValid is true and whether the transaction that
created the Lob is still active.
|
void |
completeLocalCommit(Iterator listenerIterator) |
void |
completeLocalRollback(Iterator listenerIterator) |
protected void |
finalize() |
Agent |
getAgent() |
int |
getLocator()
Get locator for this Lob
|
protected void |
incrementUpdateCount()
Increments and returns the new updateCount
of this
Lob. |
protected static boolean |
isLayerBStreamingPossible(Agent agent) |
static boolean |
isLengthObtained(Lob l) |
boolean |
isLocator()
Check whether this Lob is based on a locator
|
abstract long |
length() |
void |
listenToUnitOfWork() |
protected abstract void |
materializeStream()
Method to be implemented by subclasses, so that
#materializedStream(InputStream, String) can be called with subclass
specific parameters and the result assigned to the right stream.
|
protected InputStream |
materializeStream(InputStream is,
String typeDesc)
Materialize the given stream into memory and update the internal
length variable.
|
boolean |
willBeLayerBStreamed() |
public static final int STRING
public static final int ASCII_STREAM
public static final int UNICODE_STREAM
public static final int CHARACTER_STREAM
public static final int BINARY_STREAM
public static final int BINARY_STRING
public static final int LOCATOR
public static final int INVALID_LOCATOR
protected Agent agent_
protected int dataType_
protected int locator_
protected boolean isValid_
protected static final ClientMessageId LOB_OBJECT_LENGTH_UNKNOWN_YET
protected final CallableLocatorProcedures locatorProcs_
protected final String columnName
protected void finalize()
throws Throwable
public void listenToUnitOfWork()
listenToUnitOfWork in interface UnitOfWorkListenerpublic void completeLocalCommit(Iterator listenerIterator)
completeLocalCommit in interface UnitOfWorkListenerpublic void completeLocalRollback(Iterator listenerIterator)
completeLocalRollback in interface UnitOfWorkListenerpublic Agent getAgent()
protected abstract void materializeStream()
throws SqlException
SqlExceptionprotected InputStream materializeStream(InputStream is, String typeDesc) throws SqlException
is - stream to use for inputtypeDesc - description of the data type we are inserting,
for instance java.sql.ClobSqlException - if the stream exceeds 2 GB, or an error happens
while reading from the streampublic static boolean isLengthObtained(Lob l)
public abstract long length()
throws SQLException
SQLExceptionprotected static boolean isLayerBStreamingPossible(Agent agent)
public boolean willBeLayerBStreamed()
public boolean isLocator()
public int getLocator()
protected void checkPosAndLength(long pos,
long length)
throws SQLException
pos and length.pos - a long that contains the position that needs to be checkedlength - a long that contains the length that needs to be checkedSQLException - if
a) pos <= 0
b) pos > (length of LOB)
c) length < 0
d) pos + length > (length of LOB)protected void incrementUpdateCount()
Lob. The method needs to be
synchronized since multiple updates can
happen on this Lob simultaneously.
It will be called from the
1) Locator Writers
2) Locator OutputStreams
3) From the update methods
within the Lobs like setString, truncate.
since all of the above acesses are inside
the am package, this method will have
default access. We do not need to worry
about the non-locator streams since
non-locator InputStreams would not
depend on updateCount for invalidationprotected void checkValidity()
throws SQLException
SQLException - if isValid is not true or the transaction that
created the Lob is not activeCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.