Permalink
Browse files

#236 Remove transactions from the spec, RI and tck

  • Loading branch information...
gregrluck committed Sep 4, 2013
1 parent 2df6fc7 commit b277cc75e10f62fe4ef8390aa3aaea99dd6dd075
View
@@ -79,7 +79,6 @@ The RI is there to ensure that the specification and API works.
For example, some things that we leave out:
-- implementation of transactions.
- tiered storage. A simple on-heap store is used.
- replicated or distributed caching
View
@@ -2,7 +2,6 @@ Export-Package: javax.cache;\
javax.cache.annotation;\
javax.cache.event;\
javax.cache.spi;\
- javax.cache.transaction;
Bundle-SymbolicName: javax.cache
Bundle-Version: ${project.version}
View
@@ -55,12 +55,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
@@ -44,7 +44,6 @@
* when a value being created/updated/removed from a cache</li>
* <li>provide the ability to observe cache entry changes</li>
* <li>may capture and measure operational statistics</li>
- * <li>may be transactional</li>
* </ol>
* <p/>
* A simple example of how to use a cache is:
@@ -10,7 +10,6 @@
import javax.cache.configuration.Configuration;
import javax.cache.management.CacheMXBean;
import javax.cache.spi.CachingProvider;
-import javax.transaction.UserTransaction;
import java.io.Closeable;
import java.lang.management.ManagementFactory;
import java.net.URI;
@@ -104,10 +103,6 @@
* validated within the context of the {@link CacheManager} properties and
* implementation.
* <p/>
- * For example: Attempting to use a {@link Configuration} requiring
- * transactional support with an implementation that does not support
- * transactions will result in an {@link UnsupportedOperationException}.
- * <p/>
* Implementers should be aware that the {@link Configuration} may be used to
* configure other {@link Cache}s.
* <p/>
@@ -228,15 +223,6 @@
*/
void destroyCache(String cacheName);
- /**
- * Obtains a UserTransaction for transactional {@link Cache}s managed
- * by the {@link CacheManager}.
- *
- * @return the UserTransaction
- * @throws UnsupportedOperationException if JTA is not supported
- */
- UserTransaction getUserTransaction();
-
/**
* Controls whether management is enabled. If enabled the {@link CacheMXBean}
* for
@@ -13,8 +13,6 @@
import javax.cache.expiry.ExpiryPolicy;
import javax.cache.integration.CacheLoader;
import javax.cache.integration.CacheWriter;
-import javax.cache.transaction.IsolationLevel;
-import javax.cache.transaction.Mode;
import java.io.Serializable;
import java.util.List;
@@ -115,12 +113,6 @@
* transformation
* may not be reflected in the cache.
* <p/>
- * Additionally Store-By-Reference is only supported for non-transactional caches.
- * Attempts
- * to configure a cache using both transactions and Store-By-Reference will result in
- * an
- * in a CacheException.
- * <p/>
* When a cache is storeByValue, any mutation to the key or value does not affect the
* key of value
* stored in the cache.
@@ -149,36 +141,6 @@
*/
public abstract boolean isManagementEnabled();
- /**
- * Checks whether transactions are enabled for this cache.
- * <p/>
- * Note that in a transactional cache, entries being mutated within a
- * transaction cannot be expired by the cache.
- * <p/>
- * The default value is <code>false</code>.
- *
- * @return true if transaction are enabled
- */
- public abstract boolean isTransactionsEnabled();
-
- /**
- * Gets the transaction isolation level.
- * <p/>
- * The default value is {@link IsolationLevel#NONE}.
- *
- * @return the isolation level.
- */
- public abstract IsolationLevel getTransactionIsolationLevel();
-
- /**
- * Gets the transaction mode.
- * <p/>
- * The default value is {@link Mode#NONE}.
- *
- * @return the mode of the cache.
- */
- public abstract Mode getTransactionMode();
-
/**
* Obtains the {@link CacheEntryListenerConfiguration}s for {@link CacheEntryListener}s
* to be configured on a {@link Cache}.
@@ -24,8 +24,6 @@
import javax.cache.expiry.ExpiryPolicy;
import javax.cache.integration.CacheLoader;
import javax.cache.integration.CacheWriter;
-import javax.cache.transaction.IsolationLevel;
-import javax.cache.transaction.Mode;
import java.util.ArrayList;
import java.util.List;
@@ -98,21 +96,6 @@
*/
protected boolean isStoreByValue;
- /**
- * A flag indicating if the cache will use transactions.
- */
- protected boolean isTransactionsEnabled;
-
- /**
- * The transaction {@link IsolationLevel}.
- */
- protected IsolationLevel txnIsolationLevel;
-
- /**
- * The transaction {@link Mode}.
- */
- protected Mode txnMode;
-
/**
* Whether management is enabled
*/
@@ -134,9 +117,6 @@ public MutableConfiguration() {
this.isStatisticsEnabled = false;
this.isStoreByValue = true;
this.isManagementEnabled = false;
- this.isTransactionsEnabled = false;
- this.txnIsolationLevel = IsolationLevel.NONE;
- this.txnMode = Mode.NONE;
}
/**
@@ -174,10 +154,6 @@ public MutableConfiguration(Configuration<K, V> configuration) {
this.isStoreByValue = configuration.isStoreByValue();
this.isManagementEnabled = configuration.isManagementEnabled();
-
- this.isTransactionsEnabled = configuration.isTransactionsEnabled();
- this.txnIsolationLevel = configuration.getTransactionIsolationLevel();
- this.txnMode = configuration.getTransactionMode();
}
/**
@@ -321,38 +297,6 @@ public MutableConfiguration(Configuration<K, V> configuration) {
return this;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public IsolationLevel getTransactionIsolationLevel() {
- return this.txnIsolationLevel;
- }
-
- /**
- * Set the Transaction {@link IsolationLevel} and {@link Mode},
- * which also sets {@link #isTransactionsEnabled()} to true.
- *
- * @param level the {@link IsolationLevel}
- * @param mode the {@link Mode}
- * @return the {@link MutableConfiguration} to permit fluent-style method calls
- */
- public MutableConfiguration<K, V> setTransactions(IsolationLevel level,
- Mode mode) {
- this.txnIsolationLevel = level;
- this.txnMode = mode;
- this.isTransactionsEnabled = true;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Mode getTransactionMode() {
- return this.txnMode;
- }
-
/**
* {@inheritDoc}
*/
@@ -463,14 +407,6 @@ public boolean isManagementEnabled() {
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isTransactionsEnabled() {
- return this.isTransactionsEnabled;
- }
-
/**
* {@inheritDoc}
*/
@@ -494,11 +430,6 @@ public int hashCode() {
result = prime * result + (isStatisticsEnabled ? 1231 : 1237);
result = prime * result + (isStoreByValue ? 1231 : 1237);
result = prime * result + (isWriteThrough ? 1231 : 1237);
- result = prime
- * result
- + ((txnIsolationLevel == null) ? 0 : txnIsolationLevel
- .hashCode());
- result = prime * result + ((txnMode == null) ? 0 : txnMode.hashCode());
return result;
}
@@ -565,15 +496,6 @@ public boolean equals(Object object) {
if (isWriteThrough != other.isWriteThrough) {
return false;
}
- if (isTransactionsEnabled != other.isTransactionsEnabled) {
- return false;
- }
- if (txnIsolationLevel != other.txnIsolationLevel) {
- return false;
- }
- if (txnMode != other.txnMode) {
- return false;
- }
return true;
}
}
@@ -15,11 +15,6 @@
*/
public enum OptionalFeature {
- /**
- * Implementation supports XA and Local Transactions
- */
- TRANSACTIONS,
-
/**
* Implementation supports store by reference
*/
@@ -39,12 +39,6 @@
* A listener which mutates a cache on the CacheManager may cause a deadlock.
* Detection and response to deadlocks is implementation specific.
* <p/>
- * A listener on a transactional cache is executed orthogonally to the transaction.
- * If synchronous it is executed after the mutation and not after the transaction
- * commits, and if asynchronous the timing is undefined. A listener which throws
- * an exception will not affect the transaction. A transaction which is rolled back
- * will not unfire a listener.
- *
* @param <K> the type of key
* @param <V> the type of value
* @author Yannis Cosmadopoulos
@@ -17,9 +17,7 @@
<p/>
Listeners are invoked <strong>after</strong> the cache is updated. If the listener throws
an {@link javax.cache.event.CacheEntryCreatedListener} this will propagate back to the caller but it does not affect the cache update
- as it already completed before the listener was called. If the cache is transactional, transactions
- must commit <strong>before</strong> listeners are called. If an exception is thrown by a listener this does not
- affect the transaction as the transaction has already completed.
+ as it already completed before the listener was called.
<p/>
@author Greg Luck
@author Yannis Cosmadopoulos
@@ -26,8 +26,6 @@
* partial success, the collection of entries must contain only those entries
* which failed.
* <p/>
- * The semantics of Transactional Consistency are implementation specific.
- * <p/>
* The entry passed into {@link #write(Cache.Entry)} is independent
* of the cache mapping for that key, meaning that if the value changes in the
* cache or is removed it does not change the said entry.
@@ -9,8 +9,6 @@
import javax.cache.Cache;
import javax.cache.integration.CacheLoader;
import javax.cache.integration.CacheWriter;
-import javax.cache.transaction.IsolationLevel;
-import javax.cache.transaction.Mode;
import javax.management.MXBean;
/**
@@ -126,34 +124,4 @@
*/
boolean isManagementEnabled();
- /**
- * Checks whether transactions are enabled for this cache.
- * <p/>
- * Note that in a transactional cache, entries being mutated within a
- * transaction cannot be expired by the cache.
- * <p/>
- * The default value is <code>false</code>.
- *
- * @return true if transaction are enabled
- */
- boolean isTransactionsEnabled();
-
- /**
- * Gets the transaction isolation level.
- * <p/>
- * The default value is {@link IsolationLevel#NONE}.
- *
- * @return the isolation level.
- */
- IsolationLevel getTransactionIsolationLevel();
-
- /**
- * Gets the transaction mode.
- * <p/>
- * The default value is {@link Mode#NONE}.
- *
- * @return the mode of the cache.
- */
- Mode getTransactionMode();
-
}
Oops, something went wrong.

0 comments on commit b277cc7

Please sign in to comment.