Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Removed 'batchSafely' methods as they are now deprecated and
Browse files Browse the repository at this point in the history
counterindicated
  • Loading branch information
bwmcadams committed Nov 3, 2010
1 parent 460ef59 commit 84cf2ba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
18 changes: 0 additions & 18 deletions casbah-core/src/main/scala/MongoCollection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -381,24 +381,6 @@ class MongoCollection(val underlying: com.mongodb.DBCollection) extends MongoCol
*/
def request(op: MongoCollection => Unit) = getDB.request(db => op(db(name)))

/**
* "Safe" mode operation for batch update ops.
* Guarantees that the operations in the passed
* block are executed in the same connection
* via requestStart() and requestDone().
* Resets errors & Calls getPRevError afterwards,
*
* IF you need only to do one op, use safely.
*
* Your op function gets a copy of this MongoDB.
*
* This is for update ops only - you cannot return data from it.
*
*
* @throws MongoException
*/
def batchSafely(op: MongoCollection => Unit) = getDB.batchSafely(db => op(db(name)))

}

/**
Expand Down
36 changes: 0 additions & 36 deletions casbah-core/src/main/scala/MongoDB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,41 +129,5 @@ class MongoDB(val underlying: com.mongodb.DB) {
requestDone
}

/**
* "Safe" mode operation for batch update ops.
* Guarantees that the operations in the passed
* block are executed in the same connection
* via requestStart() and requestDone().
* Resets errors & Calls getPRevError afterwards,
*
* IF you need only to do one op, use safely.
*
* Your op function gets a copy of this MongoDB.
*
* This is for update ops only - you cannot return data from it.
*
*
* @throws MongoException
*/
def batchSafely(op: MongoDB => Unit) {
// Reset the error memory for the DB
resetError

// Lock the connection handle (e.g. no pooled calls)
requestStart

// Exec the op
op(this)

// If anything failed, throw the exception
getPreviousError.throwOnError

// Unlock the connection
requestDone
}




override def toString() = underlying.toString
}

0 comments on commit 84cf2ba

Please sign in to comment.