pjfanning commented on code in PR #92:
URL: 
https://github.com/apache/pekko-persistence-r2dbc/pull/92#discussion_r1617756643


##########
core/src/main/scala/org/apache/pekko/persistence/r2dbc/state/scaladsl/DurableStateDao.scala:
##########
@@ -281,6 +284,28 @@ private[r2dbc] class DurableStateDao(settings: 
R2dbcSettings, connectionFactory:
     result.map(_ => Done)(ExecutionContexts.parasitic)
   }
 
+  /**
+   * @param persistenceId The persistence id for the object
+   * @param revision The revision to delete
+   * @return The number of rows deleted
+   * @since 1.1.0
+   */
+  def deleteStateForRevision(persistenceId: String, revision: Long): 
Future[Long] = {
+    val result =
+      r2dbcExecutor.updateOne(s"delete [$persistenceId, $revision]") { 
connection =>
+        connection
+          .createStatement(deleteStateWithRevisionSql)
+          .bind(0, persistenceId)
+          .bind(1, revision)
+      }
+
+    if (log.isDebugEnabled())
+      result.foreach(_ =>

Review Comment:
   I had to revert my change. The Scala 2.12 compiler can't handle the updated 
log stmt.
   
   ```
   [error] 
/Users/pj.fanning/code/incubator-pekko-persistence-r2dbc/core/src/main/scala/org/apache/pekko/persistence/r2dbc/state/scaladsl/DurableStateDao.scala:306:13:
 overloaded method value debug with alternatives:
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Object*)Unit <and>
   [error]   (x$1: org.slf4j.Marker,x$2: String,x$3: Any,x$4: Any)Unit <and>
   [error]   (x$1: String,x$2: Object*)Unit
   [error]  cannot be applied to (String, String, Long, Long)
   [error]         log.debug("Deleted durable state for persistenceId [{}]; 
revision [{}]; deleted {} rows",
   ```
   
   The compiler should plainly use the `(x$1: String,x$2: Object*)Unit` method. 
None of my parameters are of `org.slf4j.Marker` type.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to