public final class InlineBlobCache extends java.lang.Object implements DatabaseListener, TransactionListener
| Constructor and Description |
|---|
InlineBlobCache(FbDatabase database)
Creates an inline blob cache with the
maxBlobCacheSize configured for database. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(FbTransaction transaction,
InlineBlob blob)
Adds an inline blob to the cache for the transaction and blob id.
|
void |
detached(FbDatabase database)
Called when the
database connection has been detached |
java.util.Optional<InlineBlob> |
getAndRemove(FbTransaction transaction,
long blobId)
Gets an inline blob for the transaction and blob id and removes it from the cache.
|
int |
maxSize() |
int |
size() |
void |
transactionStateChanged(FbTransaction transaction,
TransactionState newState,
TransactionState previousState)
Signals that the transaction state changed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdetaching, warningReceivedpublic InlineBlobCache(FbDatabase database)
maxBlobCacheSize configured for database.database - database instancepublic int maxSize()
-1 if the cache is disabledpublic int size()
public java.util.Optional<InlineBlob> getAndRemove(FbTransaction transaction, long blobId)
transaction - transactionblobId - blob idgetAndRemove(int, long)public boolean add(FbTransaction transaction, InlineBlob blob)
The inline blob is not stored in the cache if:
transaction is not activeFbTransaction.getHandle() is not equal to InlineBlob.getTransactionHandle()
If the blob is stored, this cache is added as a transaction listener of transaction.
transaction - transactionblob - inline blobtrue if the blob was added to the cache, false otherwisepublic void transactionStateChanged(FbTransaction transaction, TransactionState newState, TransactionState previousState)
TransactionListenertransactionStateChanged in interface TransactionListenertransaction - FbTransaction that changed statepublic void detached(FbDatabase database)
DatabaseListenerdatabase connection has been detacheddetached in interface DatabaseListenerdatabase - The database object that was detachedCopyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.