2.1.0 TableQuery Thread-safety

43 views
Skip to first unread message

Raymond Lau

unread,
Apr 20, 2015, 3:33:03 PM4/20/15
to scala...@googlegroups.com
Hey guys, is TableQuery thread-safe?

Let's say I have the following setup:

class MyTable(tag) extends Table[CaseClass](tag, "my_table) {
  ...
}

object MyTable {
  val table = TableQuery[MyTable]
}

MyTable.table.filter(_.id === 2).list

Is it ok to use TableQuery this way?  Or should I be creating a new instance of it each time I use it?

Naftoli Gugenheim

unread,
Apr 20, 2015, 8:29:26 PM4/20/15
to scala...@googlegroups.com

Yes that is how it's meant to be used. I very highly doubt there's any mutability inside.


--

---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/420e2f86-7cde-40e2-b235-2669559e4bed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raymond Lau

unread,
Apr 21, 2015, 4:24:15 PM4/21/15
to scala...@googlegroups.com
Cool, thanks!

--

---
You received this message because you are subscribed to a topic in the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalaquery/PjFcRJi2YuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/CANpg8PDbzUw_Q2FBDzo-T%2B8NDAYDhVGOaG7cW2nbPuFVvRrjdw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages