org.akubraproject.txn
Class SQLTransactionalConnection

java.lang.Object
  extended by org.akubraproject.impl.AbstractBlobStoreConnection
      extended by org.akubraproject.txn.AbstractTransactionalConnection
          extended by org.akubraproject.txn.SQLTransactionalConnection
All Implemented Interfaces:
Synchronization, org.akubraproject.BlobStoreConnection
Direct Known Subclasses:
TransactionalConnection

public abstract class SQLTransactionalConnection
extends AbstractTransactionalConnection

A basic superclass for sql-based transactional store connections. This just closes the sql connection at the end and provides an Iterator implementation for implementing listBlobIds.

Author:
Ronald Tschalär

Nested Class Summary
protected static class SQLTransactionalConnection.RSBlobIdIterator
          A ResultSet based Iterator of blob-id's.
 
Nested classes/interfaces inherited from class org.akubraproject.txn.AbstractTransactionalConnection
AbstractTransactionalConnection.TxnBlob
 
Field Summary
protected  Connection con
          The db connection being used
protected  XAConnection xaCon
          The xa connection being used
 
Fields inherited from class org.akubraproject.txn.AbstractTransactionalConnection
blobCache, bStoreCon, delBlobs, isCompleted, newBlobs, tx
 
Fields inherited from class org.akubraproject.impl.AbstractBlobStoreConnection
closed, owner, streamManager
 
Constructor Summary
protected SQLTransactionalConnection(org.akubraproject.BlobStore owner, org.akubraproject.BlobStore bStore, XAConnection xaCon, Connection con, Transaction tx, Map<String,String> hints)
          Create a new sql-based transactional connection.
 
Method Summary
 void afterCompletion(int status)
          Invoked after the transaction has completed, i.e.
 
Methods inherited from class org.akubraproject.txn.AbstractTransactionalConnection
addBlob, addNameEntry, beforeCompletion, getBlob, getRealId, remBlob, remNameEntry, sync, validateId
 
Methods inherited from class org.akubraproject.impl.AbstractBlobStoreConnection
close, ensureOpen, getBlob, getBlobStore, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.akubraproject.BlobStoreConnection
listBlobIds
 

Field Detail

xaCon

protected final XAConnection xaCon
The xa connection being used


con

protected final Connection con
The db connection being used

Constructor Detail

SQLTransactionalConnection

protected SQLTransactionalConnection(org.akubraproject.BlobStore owner,
                                     org.akubraproject.BlobStore bStore,
                                     XAConnection xaCon,
                                     Connection con,
                                     Transaction tx,
                                     Map<String,String> hints)
                              throws IOException
Create a new sql-based transactional connection.

Parameters:
owner - the blob-store we belong to
bStore - the underlying blob-store to use
xaCon - the xa connection to use
con - the db connection to use
tx - the transaction we belong to
hints - the hints to pass to openConnection on bStore
Throws:
IOException - if an error occurs initializing this connection
Method Detail

afterCompletion

public void afterCompletion(int status)
Description copied from class: AbstractTransactionalConnection
Invoked after the transaction has completed, i.e. after a rollback or commit has finished. This is always callled.

Subclasses that override this must make sure to invoke super.afterCompletion so that the cleanup code in this implementation is run. This implementation cleans up deleted or added blobs (depending on the outcome of the transaction).

Specified by:
afterCompletion in interface Synchronization
Overrides:
afterCompletion in class AbstractTransactionalConnection
See Also:
Synchronization.afterCompletion(int)


Copyright © 2009-2012 DuraSpace. All Rights Reserved.