001: package com.completex.objective.components.persistency.transact.impl;
002:
003: import com.completex.objective.components.persistency.transact.Transaction;
004: import com.completex.objective.components.persistency.transact.TransactionListener;
005: import com.completex.objective.components.OdalRuntimeException;
006:
007: import java.sql.*;
008: import java.util.List;
009:
010: /**
011: * Transaction implementation that never commits or rolls back
012: *
013: * @author Gennady Krizhevsky
014: */
015: public class JoiningNullTransactionImpl implements Transaction {
016:
017: private final Transaction coreTransaction;
018:
019: public JoiningNullTransactionImpl(Transaction databaseTransaction) {
020: this .coreTransaction = databaseTransaction;
021: }
022:
023: public String connectionToString() {
024: return coreTransaction.connectionToString();
025: }
026:
027: public List flush() throws SQLException {
028: return coreTransaction.flush();
029: }
030:
031: public Statement createStatement() throws SQLException {
032: return coreTransaction.createStatement();
033: }
034:
035: public PreparedStatement prepareStatement(String sql)
036: throws SQLException {
037: return coreTransaction.prepareStatement(sql);
038: }
039:
040: public CallableStatement prepareCall(String sql)
041: throws SQLException {
042: return coreTransaction.prepareCall(sql);
043: }
044:
045: public void releaseStatement(PreparedStatement statement)
046: throws SQLException {
047: coreTransaction.releaseStatement(statement);
048: }
049:
050: public Connection getConnection() {
051: return coreTransaction.getConnection();
052: }
053:
054: /**
055: * Does nothing
056: */
057: public void commit() throws SQLException {
058: }
059:
060: /**
061: * Does nothing
062: */
063: public void rollback() throws SQLException {
064: }
065:
066: public void commitUnchecked() {
067: }
068:
069: public void rollbackUnchecked() {
070: }
071:
072: /**
073: * Does nothing
074: */
075: public void rollbackSilently() {
076: }
077:
078: public void addListerner(Object key, TransactionListener listener) {
079: coreTransaction.addListerner(key, listener);
080: }
081:
082: public TransactionListener getListener(Object key) {
083: return coreTransaction.getListener(key);
084: }
085:
086: public boolean containsListener(Object key) {
087: return coreTransaction.containsListener(key);
088: }
089:
090: public void removeListerner(Object key) {
091: coreTransaction.removeListerner(key);
092: }
093:
094: public int listenersSize() {
095: return coreTransaction.listenersSize();
096: }
097:
098: public void clearListerners() {
099: coreTransaction.clearListerners();
100: }
101: }
|