Removed isTransactionalityEnabled

This commit is contained in:
Peter Vlugter 2010-06-20 10:10:09 +12:00
parent db325d8fab
commit dd7dc9e179
3 changed files with 3 additions and 28 deletions

View file

@ -1198,7 +1198,7 @@ sealed class LocalActorRef private[akka](
/** /**
* Callback for the dispatcher. This is the ingle entry point to the user Actor implementation. * Callback for the dispatcher. This is the ingle entry point to the user Actor implementation.
*/ */
protected[akka] def invoke(messageHandle: MessageInvocation): Unit = actor.synchronized { protected[akka] def invoke(messageHandle: MessageInvocation): Unit = actor.synchronized {
if (isShutdown) { if (isShutdown) {
Actor.log.warning("Actor [%s] is shut down, ignoring message [%s]", toString, messageHandle) Actor.log.warning("Actor [%s] is shut down, ignoring message [%s]", toString, messageHandle)
return return
@ -1206,8 +1206,7 @@ sealed class LocalActorRef private[akka](
sender = messageHandle.sender sender = messageHandle.sender
senderFuture = messageHandle.senderFuture senderFuture = messageHandle.senderFuture
try { try {
if (TransactionManagement.isTransactionalityEnabled) transactionalDispatch(messageHandle) dispatch(messageHandle)
else dispatch(messageHandle)
} catch { } catch {
case e => case e =>
Actor.log.error(e, "Could not invoke actor [%s]", this) Actor.log.error(e, "Could not invoke actor [%s]", this)
@ -1216,23 +1215,6 @@ sealed class LocalActorRef private[akka](
} }
private def dispatch[T](messageHandle: MessageInvocation) = { private def dispatch[T](messageHandle: MessageInvocation) = {
val message = messageHandle.message //serializeMessage(messageHandle.message)
setTransactionSet(messageHandle.transactionSet)
try {
actor.base(message)
} catch {
case e =>
_isBeingRestarted = true
Actor.log.error(e, "Could not invoke actor [%s]", toString)
// FIXME to fix supervisor restart of remote actor for oneway calls, inject a supervisor proxy that can send notification back to client
if (_supervisor.isDefined) _supervisor.get ! Exit(this, e)
senderFuture.foreach(_.completeWithException(this, e))
} finally {
clearTransaction
}
}
private def transactionalDispatch[T](messageHandle: MessageInvocation) = {
val message = messageHandle.message //serializeMessage(messageHandle.message) val message = messageHandle.message //serializeMessage(messageHandle.message)
var topLevelTransaction = false var topLevelTransaction = false
val txSet: Option[CountDownCommitBarrier] = val txSet: Option[CountDownCommitBarrier] =

View file

@ -23,15 +23,9 @@ class TransactionAwareWrapperException(val cause: Throwable, val tx: Option[Tran
object TransactionManagement extends TransactionManagement { object TransactionManagement extends TransactionManagement {
import se.scalablesolutions.akka.config.Config._ import se.scalablesolutions.akka.config.Config._
// is this needed?
val TRANSACTION_ENABLED = new AtomicBoolean(config.getBool("akka.stm.service", true))
// move to stm.global.fair? // move to stm.global.fair?
val FAIR_TRANSACTIONS = config.getBool("akka.stm.fair", true) val FAIR_TRANSACTIONS = config.getBool("akka.stm.fair", true)
def isTransactionalityEnabled = TRANSACTION_ENABLED.get
def disableTransactions = TRANSACTION_ENABLED.set(false)
private[akka] val transactionSet = new ThreadLocal[Option[CountDownCommitBarrier]]() { private[akka] val transactionSet = new ThreadLocal[Option[CountDownCommitBarrier]]() {
override protected def initialValue: Option[CountDownCommitBarrier] = None override protected def initialValue: Option[CountDownCommitBarrier] = None
} }

View file

@ -31,8 +31,7 @@
</actor> </actor>
<stm> <stm>
service = on fair = on # should global transactions be fair or non-fair (non fair yield better performance)
fair = on # should transactions be fair or non-fair (non fair yield better performance)
jta-aware = off # 'on' means that if there JTA Transaction Manager available then the STM will jta-aware = off # 'on' means that if there JTA Transaction Manager available then the STM will
# begin (or join), commit or rollback the JTA transaction. Default is 'off'. # begin (or join), commit or rollback the JTA transaction. Default is 'off'.
</stm> </stm>