Thread
#exposed
    Wyatt Kennedy

    Wyatt Kennedy

    1 year ago
    Hey, is there some way to attach data to the transaction when it is started that I could access within an EntityHook? I'd like to make a function like
    userTransaction(userId: Long, db: Database? = null, statement: Transaction.() -> T)
    , but I can't find anywhere to store data on the Transaction object, or any way to subclass transaction and use that. Any suggestions?
    Lol, after nosing around in the exposed code a bit, I found the UserDataHolder object that appears to be for this exact purpose. I'll make a PR for the wiki documentation to add a blurb on the Transaction page about it.
    tapac

    tapac

    1 year ago
    @Wyatt Kennedy There is also TransactionStore delegate which could be used as:
    var transactionValue by transactionScope { defaultValue }