[Lift] Re: Concurrency control of database access in Lift/Comet

2009-10-05 Thread donfranciscodequevedo
Thanks Kevin, I know, that this is more of a theoretical problem, but now that I have read so much about Actors and concurrent programming, I am actually curious about the underlying concurrency strategies taken by Scala. Infact I realize, that this is actually more a Scala question, than a Lift

[Lift] Re: Concurrency control of database access in Lift/Comet

2009-10-05 Thread Kevin Wright
Its really more of a Java problem, or JDBC to be specific. The normal way to configure this would be to establish a pool of connections, when a thread, or actor, needs to interact with the database it takes a connection from the pool, uses it, then returns it to the pool. This is the same

[Lift] Re: Concurrency control of database access in Lift/Comet

2009-10-05 Thread David Pollak
Howdy, I think you misunderstand how Actors work. An Actor only consumes resources while it is processing an item in its mailbox. So if an Actor is hanging out, doing nothing, it will only consume memory (like any other object.) When the Actor receives a message, it allocates some additional

[Lift] Re: Concurrency control of database access in Lift/Comet

2009-10-04 Thread Kevin Wright
In my experience, the database engine itself does a pretty good job of managing concurrent connections like this out of the box, which is much of the reason why connection pooling is so effective. Of course, thinks can be a bit interesting on the database side if you want to get really obsessive