Multiple request safe dependency injection using singleton object Scalatra

19 views
Skip to first unread message

frikk.fos...@gmail.com

unread,
Jun 21, 2018, 3:57:36 AM6/21/18
to scalatra-user
Hello.

I need to be able to pass the current authenticated user in Scentry all the way down to scalikejdbc connection to set clientInfo on the borrowed sql connection.

The project is synchronous from the ground up.

Will each request in Scalatra get their own thread, hence the singleton object will not be shared when multiple requests are received simultaneously?


Naoki Takezoe

unread,
Jun 21, 2018, 5:21:05 AM6/21/18
to scalat...@googlegroups.com
Singleton objects are shared among threads in the same JVM.

2018年6月21日(木) 16:57 <frikk.fos...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "scalatra-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scalatra-use...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
Naoki Takezoe
Reply all
Reply to author
Forward
0 new messages