the work around
private val dbTxnInit = TxnLocal( false )
private val dbTxnRef = TxnLocal( initialValue = { implicit tx =>
// Txn.setExternalDecider( this )
val res = database.beginTransaction()
...
dbTxnInit() = true
res
}
def shouldCommit( implicit txn: InTxnEnd ) : Boolean = {
// if( !dbTxnRef.isInitialized ) return true // can't call
if( !dbTxnInit.get ) return true // work around
val dbTxn = dbTxnRef() // safe to read now
...
> --
>
>
>