Dain,

full rundown is at http://www.castor.org/locking.html but my brief version
here...  (forgive me if any of this comes across as patronizing, not sure
how much exposure you've had to castor)

say I had ejb and web tiers in the same jvm, and a jsp was provided with a
collection of objects to display.

in castor, I could have two requests at the same time, both given the same
collection of objects, and access them in a read-only fashion concurrently.

(as I understand) with entity beans, using finder methods, as soon as one
entity was accessed, even in a read-only fashion, it would be locked for the
duration of that tx yes?  so the second request would have to wait until the
first tx has finished.  the common workaround is to write the query yourself
in jdbc, and use a non-ejb approach....

I know that read-only beans could solve this in some cases, but obviously
not all.  My real problem with the jdbc approach is that hte container
already has all the information required to create the sql.

a while back, I tried to create some new functionality for jboss, got it
working nicely, but then faded away - essentially, for each finder method, I
made a query method - basically following the architecture you have for the
jaws stuff - I mirrored FindEntitiesCOmmand with a QueryEntitiesCommand
(with a little refactoring to suit), and in jboss.xml had a spot for someone
to declare the class the populate.  so the home interface then has:

  public Collection findByXXX();
  public Collection queryByXXX();

the finder method of course returns ejbobjects, with all the spec behaviour.
the query method returns a collection of dataobjects, the dataobject having
the same set/get methods as the entity bean, but is actually a copy of the
data.

I had a fair bit of fun doing this, but got stumped on how to handle
relationships....  anyway, not sure that you couldn't think of a much better
way to solve the problem, but thought it might be worth sharing, just seems
that using jdbc for read-only access was quite common, and could be another
area where jboss could make it easier for the user....

would like to hear your thoughts on this, and also any more feedback on the
castor issue.

cheesr
dim

----- Original Message -----
From: "Dain Sundstrom" <[EMAIL PROTECTED]>
To: "'Dmitri Colebatch'" <[EMAIL PROTECTED]>; "Ryan Marsh"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 10:24 AM
Subject: RE: [JBoss-user] Updating CastorJDO plugin for 2.4.4


> > the main reason we looked at castor was the
> > shared access on
> > query results, so I could have two "findAll" methods running,
> > and if they
> > were both read only, there would be no lockouts.  This to me
> > is the biggest
> > disadvantage of entity beans as they currently stand, I for
> > one dont see why
> > the container doesn't provide a read-only equivalent of the finder
> > method....
>
> Can you give me more details on this?  I'm not sure what you mean by
"shared
> access on query results."  If you can explain this, maybe I can
incorporate
> it into JBossCMP.
>
> -dain
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to