On Wed, Dec 22, 2010 at 11:34 PM, Scott Burson <[email protected]> wrote:
> On Wed, Dec 22, 2010 at 12:33 PM, Stephen Compall
> <[email protected]> wrote:
>>
>> I doubt that with-database is actually sufficient.
>>
> Whoever modified the CLiki page
> (Kevin?) thinks that the primary issue is thread safety -- which was
> my initial impression as well.  It turns out that's just one problem;
> the other one, as you say, is lazy initialization of join slots.  This
> problem is not Weblocks-specific, correct?

Let me try again.  The problem _is_ thread-safety, but WITH-DATABASE
is not sufficient, because a db-object could be created in one thread
and then have a lazy join slot accessed in a different thread.  In
that case, CLSQL will use the connection from the first thread, and
that connection could be in use by some other thread (particularly
given that threads are being created and destroyed and the connections
are pooled; the thread that created the object might be long gone and
its connection in use by a new thread).

There, does that describe the problem well?  If so, then I would think
one solution would simply be for CLSQL to lock-protect the
connections.  This would lead to undesirable levels of contention if a
single connection were in use for the entire app, but given the
changes I'm suggesting, threads would normally use their own
connections; only in the case of lazy join slot initialization would
contention be possible, and therefore the amount of contention would
be minimal.

If that's right, it might also be an easier solution to get Kevin to
accept, given that he has already demonstrated no eagerness to merge
CLSQL-Fluid.

-- Scott

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" 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/weblocks?hl=en.

Reply via email to