1 /*2 * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.3 */4 package com.tcspring;5 6 import org.springframework.transaction.PlatformTransactionManager;7 import org.springframework.transaction.TransactionDefinition;8 import org.springframework.transaction.TransactionException;9 import org.springframework.transaction.TransactionStatus;10 11 /**12 * A no-op implementation of the PlatformTransactionManager interface, to use when Spring's TX infrastructure is used to13 * handle locking in DSO but no underlying TX implementation is running. TODO how to register this manager in the di14 * config?15 * 16 * @author Jonas Bonér17 */18 public class DsoTransactionManager implements PlatformTransactionManager {19 20 public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {21 return new TransactionStatus() {22 public boolean isNewTransaction() {23 throw new UnsupportedOperationException ();24 }25 26 public boolean hasSavepoint() {27 throw new UnsupportedOperationException ();28 }29 30 public void setRollbackOnly() {31 throw new UnsupportedOperationException ();32 }33 34 public boolean isRollbackOnly() {35 throw new UnsupportedOperationException ();36 }37 38 public boolean isCompleted() {39 throw new UnsupportedOperationException ();40 }41 42 public Object createSavepoint() throws TransactionException {43 throw new UnsupportedOperationException ();44 }45 46 public void rollbackToSavepoint(Object savepoint) throws TransactionException {47 throw new UnsupportedOperationException ();48 }49 50 public void releaseSavepoint(Object savepoint) throws TransactionException {51 throw new UnsupportedOperationException ();52 }53 };54 }55 56 public void commit(TransactionStatus status) throws TransactionException {57 // noop58 }59 60 public void rollback(TransactionStatus status) throws TransactionException {61 // noop62 }63 }64