Hanns Holger Rutz
unread,Oct 16, 2012, 4:42:59 AM10/16/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-stm-e...@googlegroups.com
Hi there,
I am having some trouble with exceptions not being printed under certain circumstances; I wonder if I'm doing something wrong?
I am coupling a Scala-STM transaction to a database transaction, as soon as database I/O is involved. This looks roughly like this:
val dbTxnRef = TxnLocal( initialValue = { implicit tx =>
Txn.setExternalDecider( this )
val dbTxn = dbEnv.beginTransaction( null, dbTxnCfg )
val dbTxnID = res.getId
log( "database txn begin <" + dbTxnID + ">" )
Txn.afterRollback({ status =>
log( "database txn rollback <" + dbTxnID + ">" )
dbTxn.abort()
})
dbTxn
})
Now, the above rollback hook is properly entered with the following:
RolledBack(UncaughtExceptionCause(java.lang.UnsupportedOperationException: init of empty finger tree))
But the wrapped exception is not printed to Console.err; I think this normally happens when I don't have the above TxnLocal initialized.
Is this expected behaviour? Should I just print the exception myself in the afterRollback hook?
best, .h.h.