From 4082af3601ae90b144bdf093a8ffa5524330dd61 Mon Sep 17 00:00:00 2001 From: Christian Kaps Date: Thu, 6 Apr 2017 15:12:48 +0200 Subject: [PATCH] Switch to ReactiveMongo 0.12.1 (#7) --- README.md | 2 +- build.sbt | 6 +++--- project/plugins.sbt | 2 +- .../silhouette/persistence/daos/MongoAuthInfoDAO.scala | 8 +++++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4775668..d1cc255 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ In your project/Build.scala: ```scala libraryDependencies ++= Seq( - "com.mohiva" %% "play-silhouette-persistence-reactivemongo" % "4.0.1" + "com.mohiva" %% "play-silhouette-persistence-reactivemongo" % "4.0.2" ) ``` diff --git a/build.sbt b/build.sbt index 136d752..d0309c6 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ import scalariform.formatter.preferences._ name := "play-silhouette-persistence-reactivemongo" -version := "4.0.1" +version := "4.0.2" scalaVersion := "2.11.8" @@ -22,9 +22,9 @@ resolvers += Resolver.sonatypeRepo("snapshots") libraryDependencies ++= Seq( "com.mohiva" %% "play-silhouette" % "4.0.0", "com.mohiva" %% "play-silhouette-persistence" % "4.0.0", - "org.reactivemongo" %% "play2-reactivemongo" % "0.12.0", + "org.reactivemongo" %% "play2-reactivemongo" % "0.12.1", "net.codingwell" %% "scala-guice" % "4.0.1" % "test", - "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "1.50.5" % "test", + "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.0.0" % "test", specs2 % Test ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 1abc91a..efc62f4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ // Comment to get more information during initialization logLevel := Level.Warn -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.4") +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.13") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5") diff --git a/src/main/scala/com/mohiva/play/silhouette/persistence/daos/MongoAuthInfoDAO.scala b/src/main/scala/com/mohiva/play/silhouette/persistence/daos/MongoAuthInfoDAO.scala index 5d89ade..5d9f81a 100644 --- a/src/main/scala/com/mohiva/play/silhouette/persistence/daos/MongoAuthInfoDAO.scala +++ b/src/main/scala/com/mohiva/play/silhouette/persistence/daos/MongoAuthInfoDAO.scala @@ -51,8 +51,14 @@ class MongoAuthInfoDAO[A <: AuthInfo: ClassTag: Format](reactiveMongoApi: Reacti /** * The collection to use for JSON queries. + * + * It’s generally a good practice not to assign the database and collection references to val (even to lazy val), + * as it’s better to get a fresh reference each time, to automatically recover from any previous issues + * (e.g. network failure). + * + * @see http://reactivemongo.org/releases/0.12/documentation/release-details.html */ - private val jsonCollection = reactiveMongoApi.database.map(db => db[JSONCollection](collectionName)) + private def jsonCollection = reactiveMongoApi.database.map(db => db[JSONCollection](collectionName)) /** * Finds the auth info which is linked with the specified login info.