Chip Wilson wrote:

>> However if the database is accessed both via the cache and via other
>> mechanisms (eg there could be a Client-server SQL application also
>> accessing the database, or there could be two systems sharing the
>> database,
>> each having its own cache) then CMP is necessary because the container
>> needs to know if the data in the cache is current and this requires the
>> container to know the relationship between cached objects and database
>> records.
>
>Aren't you implying some level of coupling between the persistent store
and
>the container?  It seems that this would only work if the persistent store
>was aware of the container's cache and notified the container when the
>underlying data changed, so that the cache could be flushed.  How would
this
>work in a CMP container using JDBC with an arbitrary relational dB?

Yes, there needs to be coupling. It works roughly as follows:

When a transaction running in a JVM completes, its transactional locks are
converted into cache locks (owned by the cache). If another transaction in
the same JVM needs the same data the cache lock is converted back to a
transactional lock and given to the transaction. If a transaction running
elsewhere needs the data it obtains the transactional lock. and when the
transaction completes (and assuming the data was updated) a notification is
sent to to any caches having a cache lock on the data and they flush the
now-invalid data.


Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to