https://kotlinlang.org logo
#exposed
Title
# exposed
n

Nikky

02/11/2020, 12:25 PM
is there any way to do
Database.connect
without registering the database globally ? is there a alternative to the
ThreadLocalTransactionManager
?
s

spand

02/11/2020, 12:45 PM
Looking at the code it seems easy to avoid registering it globally. Why do you not want to use
ThreadLocalTransactionManager
?
Oh the constructor is private
n

Nikky

02/11/2020, 7:34 PM
because i do have a situation where the database user is based on the session (in ktor) and i do not want to accidentally use the threadlocal database in a transaction rather than the correct one i'd rather not have it registered in threadlocal and crash at that point
t

tapac

02/16/2020, 3:23 PM
n

Nikky

02/17/2020, 9:26 AM
thanks, i would probably not have found that
2 Views