I would like OJB to include some way of creating a straight use case in
sql that fires events (x,y,z) to reflect what's happening at the DB.
That way, you still get the advantages of OJB, but you also can add
special db functionality without re-creating it at the application
level.
Example:
{EXEC do_something_complex(uid,something,something)}
fires
delete event on "Project" with uid = x
update event on "Users" with uid = y, role = 'admin'
| -----Original Message-----
| From: Richard Beauchamp [mailto:[EMAIL PROTECTED]]
| Sent: Thursday, September 12, 2002 11:37 AM
| To: OJB Users List
| Subject: Re: Thought experiment...
|
|
| > And this performance gains is only happening if one is trying to
lookup
| via
| > primary keys...
|
| Not exactly true. The cache is also used during arbitrary queries.
After a
| SELECT statement is executed and before an object is built from a
result
| set,
| OJB first checks the cache to see if the object already exists. This
| provides a
| performance gain by:
| 1. Not creating/garbage collecting another object in memory.
| 2. Not requiring additional queries if the cached object has
already
| loaded
| it's related objects.
|
|
| > ...but a single cache does not prevent my application threads
messing up
| > each others work (actually it will happen at some point!)
|
| Threads will not mess up each other's work if you:
| 1. Read/write lock your objects in the context of an ODMG
transaction.
| and
| 2. If reads/writes are done outside the context of an ODMG
transaction,
| ensure
| that any thread only modifies a private copy of an object (e.g., via
| serialization or cloning)
| and
| 3. Utilize optimistic locking.
| and
| 4. To avoid certain race conditions, apply modifications to your
| persistent
| objects and OJB source-code as explained in this previous e-mail:
| http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-
| [EMAIL PROTECTED]
| &msgId=445655 (<-- I don't think this issue has been fixed yet...)
|
|
| I'd be interested in seeing anybody's test-case that demonstrates
data-
| integrity
| problems while following the above guidelines. From my experience, if
you
| follow
| them you can safely utilize a single, global cache in OJB and thus
realize
| significant performance gains.
|
| Cheers,
|
| Richard
|
|
| --
| To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
| For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
|
| ---
| Incoming mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
|
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>