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 <[email protected]>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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---