> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Jeremy Boynes
> Sent: Saturday, June 21, 2003 4:58 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] Deadlock issue with SQL Server and other
> databases
>
>
> >
> > Are you sure this couldn't be avoided by using Instance Per
> Transaction +
> > SERIALIZABLE + Commit C?
> >
>
> If you think about it, you'd realize that this just pushes the
> deadlock into
> the database resulting in rollbacks. This is the multi-instance model
> described in the spec, but is not the way JBoss is configured by default.
>
> I happen to think making the default configuration multi-instance
> would be a
> little more disruptive than making the single-instance config we use now
> work correctly.
>

We've been doing multi-instance since JBoss 2.4.  Many customers and users
use this feature successfully.

> > If so, I'm worried that if you expand row-locking to happen
> > during finder queries, you'll break a lot of applications.
>
> That would be the same concern I expressed in the original post ;-)
>

Again, since 2.4

> But again, row-locking is meant to imply locking. The bug is that we only
> actually do it on the queries issued by LoadEntity and
> LoadRelation, and not
> on all the queries we execute. This leads to inconsistent locking and
> ultimately, the deadlock.
>
> If people wish to use READ_COMMITTED, then simply don't turn on
> row-locking.
>

But users use it that way.  Since we don't have a distributed entity cache
in 3.2, they use READ-COMMITTED + row-locking in a cluster.  In fact there
is no reason to use row-locking when you're using commit-option 'A' anyways
since JBoss handles the locking.  So why change things?

Again,  instance-per-transaction + SERIALIZABLE + Commit B or C gives you
the same behavior doesn't it?


> >
> > We do have a mechanism to denote read-only invocations, at least on the
> > Entity Bean level.
>
> Do we? I thought we only had read-only flags at the entity and
> method level,
> and they do not cover the dynamic nature of the usage. For example, when I
> call findByPrimaryKey, I may be intending to just read from the
> returned EJB
> or to update some values; the future usage determines the type of lock to
> take during the query.
>
> > I would like a plan from you on what kind of metadata
> > needs to flow within the context of an invocation.  I have done
> > some work on
> > how contextual information should flow throughout the system
> with the AOP
> > framework, but it probably needs to be expanded.  A usecase
> from you would
> > help in this arena.
> >
> See above
>

You can only define read-only methods for Entity beans, but there's no
reason we couldn't expand it to Session beans.  Push and pop read-only in a
thread local.  There's some use cases for this to optimize ECPerf better as
well.  This should really be a JB4 thing though and really a separate issue

> > Do not commit this change into the 3.2 branch until it has been fully
> > documented by you within HEAD and fully reviewed by the
> > community.  We have
> > to be very careful on how we apply fundamental changes to a maintainence
> > release like 3.2.x.  Other wise we may hinder our users from
> > upgrading to a
> > higher maintainence release because something as fundamental as
> > locking has
> > changed.
> >
>
> The purpose of the original post _was_ to bring this to the
> attention of the
> community.
>
> This is a bug fix, not a fundamental change or conflicting
> enhancement, and
> is entirely appropriate for a maintenance release (at least Scott and I
> thought so). Not fixing bugs in a timely manner is a hurdle to adoption in
> general and not what one expects from an open source project.
>
Bug fixing is one thing, but changing fundamental behavior is another.
Row-locking has been around since 2001 when I committed it to CVS.  Some
users rely on the fact that finder calls do not lock when row-locking is
set.

Ok, I reread your post and as I understand it you just want to add FOR
UPDATE(or equivalent) to sql in the CMP engine.  I was a bit worried you
were going to change the app-server-level locking schemes too.  Still, users
are a bit touchy when it comes to locking.

Again, SERIALIZABLE + instance per-transaction + commit B/C should work,
shouldn't it?  And again, row-locking is not used with commit option 'A'.

Sorry to be nit-picky, but I want to avoid another flood of locking
questions yet again.

Bill



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to