Permalink
Browse files

Prevent retry of lazy Connection acquisition attempt in BaseSession:

We used to mark the Session as open as soon as `conn` is accessed. If
the actual initialization (i.e. getting a JDBC Connection from the pool)
fails, an attempt to `close()` the Session would trigger another
initialization attempt. This change marks the Session as open only after
initialization has succeeded.

Fixes #1181.
  • Loading branch information...
szeiger committed Aug 27, 2015
1 parent ed954e5 commit bcdeeaa6bb2a9e29c2827214679603c9f1c84d89
Showing with 6 additions and 1 deletion.
  1. +6 −1 slick/src/main/scala/slick/jdbc/JdbcBackend.scala
@@ -427,7 +427,12 @@ trait JdbcBackend extends RelationalBackend {
def isOpen = open
def isInTransaction = inTransactionally > 0
lazy val conn = { open = true; database.source.createConnection }
lazy val conn = {
val c = database.source.createConnection
open = true
c
}
lazy val metaData = conn.getMetaData()
def capabilities = {

0 comments on commit bcdeeaa

Please sign in to comment.