Assuming that the PersistenceManager is thread-safe, it should be very easy
to crib from ScalaJPA to make a ScalaJDO. Off the top of my head:

import javax.jdo.PersistenceManager
trait JDOFactory {
  protected def openPM () : PersistenceManager
  protected def closePM (toClose : PersistenceManager) : Unit
}

trait ScalaPersistenceManager {
  protected def pm : PersistenceManager

  // define Scala-ish analogues for PersistenceManager, if needed
  ...
}

trait RequestVarPM extends JDOFactory with ScalaPersistenceManager {
  object pmVar extends
RequestVar[PersistenceManager](openPersistenceManager()) {
    this.registerGlobalCleanupFunc(ignore => closePM(this.is))
  }

  protected def pm = pmVar.is
}

Just a rough sketch, but that would allow you to do:

object Model extends RequestVarPM

And then have a per-request PersistenceManager


Derek

On Fri, May 22, 2009 at 12:38 PM, Channing Walton <channingwal...@mac.com>wrote:

>
> Yes I meant the ScalaJPA.
>
> Channing
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to