RE: Default Cache - bug? design catostrophe? user error?
Hi, I allso have this problem. It is because you have since some version after 0.9.6 a direct reference to the objects in the cash of OJB. If you have an object A with attribute a,b,c and you save this, then the object in the cach is a reference to A. So if you now change the attribute b, then on the same time the attribute b is also changed in the cach. If you try now to update the object, then the cach think there was no changes, and no update will be send to the db. For me it is a bug. My workaround is to make an clone of object A before a save it. regards Matthias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 3. April 2003 16:32 To: [EMAIL PROTECTED] Subject: RE: Default Cache - bug? design catostrophe? user error? For me the problem appears without any reference/collection. If you get a simple query to retrieve an object, modify an attribute of this object in the database and get this object a second time the attribute won't be updated. Is it a bug or is there something wrong in my app? Sylvain -Message d'origine- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Date: jeudi, 3. avril 2003 16:20 À: OJB Users List Cc: [EMAIL PROTECTED] Objet: RE: Default Cache - bug? design catostrophe? user error? Well, that kind of works. That is, it works great, unless you have bidirectional references that you want refreshed, in which case you get a Stack Overflow |-+---> | | Ron Gallagher | | | <[EMAIL PROTECTED]| | | uth.net>| | | | | | 04/02/2003 11:48| | | AM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--- ---| | | |To: [EMAIL PROTECTED] | | cc: | | Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--- ---| David -- It's not used by the cache. It's used by the PersistenceBroker when it retrieves an object. If the 'target' object is found in the cache, then any reference/collection descriptors that are marked with refresh="true" are re-populated before the 'target' is returned to the caller. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 11:44:27 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Subject: Re: RE: Default Cache - bug? design catostrophe? user error? > > > No, I haven't. I will take a look at that, but the code I saw in the cache > didn't look like it would do that - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
I think what you're describing is a different problem. If your changing your database outside of OJB, then you probably don't want to use the "standard cache". |-+-> | | <[EMAIL PROTECTED]| | | isscom.com> | | | | | | 04/03/2003 09:32 | | | AM| | | Please respond to | | | "OJB Users List" | | | | |-+-> >--| | | |To: <[EMAIL PROTECTED]> | |cc: | |Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| For me the problem appears without any reference/collection. If you get a simple query to retrieve an object, modify an attribute of this object in the database and get this object a second time the attribute won't be updated. Is it a bug or is there something wrong in my app? Sylvain -Message d'origine- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Date: jeudi, 3. avril 2003 16:20 À: OJB Users List Cc: [EMAIL PROTECTED] Objet: RE: Default Cache - bug? design catostrophe? user error? Well, that kind of works. That is, it works great, unless you have bidirectional references that you want refreshed, in which case you get a Stack Overflow |-+---> | | Ron Gallagher | | | <[EMAIL PROTECTED]| | | uth.net>| | | | | | 04/02/2003 11:48| | | AM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> > ------| | | | To: [EMAIL PROTECTED] | | cc: | |Subject: RE: Default Cache - bug? design catostrophe? user error? | | | > --| David -- It's not used by the cache. It's used by the PersistenceBroker when it retrieves an object. If the 'target' object is found in the cache, then any reference/collection descriptors that are marked with refresh="true" are re-populated before the 'target' is returned to the caller. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 11:44:27 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Subject: Re: RE: Default Cache - bug? design catostrophe? user error? > > > No, I haven't. I will take a look at that, but the code I saw in the cache > didn't look like it would do that - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
For me the problem appears without any reference/collection. If you get a simple query to retrieve an object, modify an attribute of this object in the database and get this object a second time the attribute won't be updated. Is it a bug or is there something wrong in my app? Sylvain -Message d'origine- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Date: jeudi, 3. avril 2003 16:20 À: OJB Users List Cc: [EMAIL PROTECTED] Objet: RE: Default Cache - bug? design catostrophe? user error? Well, that kind of works. That is, it works great, unless you have bidirectional references that you want refreshed, in which case you get a Stack Overflow |-+---> | | Ron Gallagher | | | <[EMAIL PROTECTED]| | | uth.net>| | | | | | 04/02/2003 11:48| | | AM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--| | | |To: [EMAIL PROTECTED] | |cc: | | Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| David -- It's not used by the cache. It's used by the PersistenceBroker when it retrieves an object. If the 'target' object is found in the cache, then any reference/collection descriptors that are marked with refresh="true" are re-populated before the 'target' is returned to the caller. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 11:44:27 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Subject: Re: RE: Default Cache - bug? design catostrophe? user error? > > > No, I haven't. I will take a look at that, but the code I saw in the cache > didn't look like it would do that - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
Well, that kind of works. That is, it works great, unless you have bidirectional references that you want refreshed, in which case you get a Stack Overflow |-+---> | | Ron Gallagher | | | <[EMAIL PROTECTED]| | | uth.net>| | | | | | 04/02/2003 11:48| | | AM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--| | | |To: [EMAIL PROTECTED] | |cc: | | Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| David -- It's not used by the cache. It's used by the PersistenceBroker when it retrieves an object. If the 'target' object is found in the cache, then any reference/collection descriptors that are marked with refresh="true" are re-populated before the 'target' is returned to the caller. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 11:44:27 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Subject: Re: RE: Default Cache - bug? design catostrophe? user error? > > > No, I haven't. I will take a look at that, but the code I saw in the cache > didn't look like it would do that - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
David -- It's not used by the cache. It's used by the PersistenceBroker when it retrieves an object. If the 'target' object is found in the cache, then any reference/collection descriptors that are marked with refresh="true" are re-populated before the 'target' is returned to the caller. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 11:44:27 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Subject: Re: RE: Default Cache - bug? design catostrophe? user error? > > > No, I haven't. I will take a look at that, but the code I saw in the cache > didn't look like it would do that - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Default Cache - bug? design catostrophe? user error?
No, I haven't. I will take a look at that, but the code I saw in the cache didn't look like it would do that |-+---> | | Ron Gallagher | | | <[EMAIL PROTECTED]| | | uth.net>| | | | | | 04/02/2003 08:34| | | AM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--| | | |To: [EMAIL PROTECTED] | |cc: | | Subject: Re: RE: Default Cache - bug? design catostrophe? user error? | | | >--| David -- Have you tried setting refresh="true" for the reference-descriptor? If this is set, then when you retrieve object A, the reference to B will be refreshed. Based on the code that I reviewed, this refresh happens both when A is initially retrieved from the database and when it's pulled from the cache. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 08:11:15 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: "'OJB Users List'" <[EMAIL PROTECTED]> > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > It's not the transaction isolation that's a concern. I think the > PerBrokerCache has the same problem, which is that directly or indirectly, > the cache contains an invalid representation of what's in the database, > while there are no transactions in progress. > > > > > |-+> > | | Mahler Thomas| > | | <[EMAIL PROTECTED]| > | | ellium.com> | > | || > | | 04/02/2003 02:22 | > | | AM | > | | Please respond to| > | | "OJB Users List" | > | || > |-+> > > ------------------------------| > | | > |To: "'OJB Users List'" <[EMAIL PROTECTED]> | > |cc: | > |Subject: RE: Default Cache - bug? design catostrophe? user error? | > | | > > --| > > > > The DefaultCache is a global cache that does not isolate broker > transactions. > You can use other cache implementations (like the PerBrokerCache) that > isolate transactions. > > We hope get those issues fixed till 1.0 > > Thomas > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, April 01, 2003 9:28 PM > > To: OJB Users List > > Cc: OJB Users List > > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > > > > > > Well, that DOES work, but in a multi-user environment, I > > would consider > > this fairly drastic. Of course, if my other option is to not > > have a cache > > at all > > > > > > > > > > > > |-+---> > > | | "Scott Howlett" | > > | | <[EMAIL PROTECTED]| > > | | .com> | > > | | | > > | | 04/01/2003 01:40| > > | | PM | > > |
RE: Default Cache - bug? design catostrophe? user error?
Actually PerBrokerCache contains *no* representation of what's in the database while there are not transactions in progress. Can't get much more consistent than that. :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 7:11 AM To: OJB Users List Cc: 'OJB Users List' Subject: RE: Default Cache - bug? design catostrophe? user error? It's not the transaction isolation that's a concern. I think the PerBrokerCache has the same problem, which is that directly or indirectly, the cache contains an invalid representation of what's in the database, while there are no transactions in progress. |-+> | | Mahler Thomas| | | <[EMAIL PROTECTED]| | | ellium.com> | | || | | 04/02/2003 02:22 | | | AM | | | Please respond to| | | "OJB Users List" | | || |-+> >--| | | |To: "'OJB Users List'" <[EMAIL PROTECTED]> | |cc: | |Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| The DefaultCache is a global cache that does not isolate broker transactions. You can use other cache implementations (like the PerBrokerCache) that isolate transactions. We hope get those issues fixed till 1.0 Thomas > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 9:28 PM > To: OJB Users List > Cc: OJB Users List > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > > Well, that DOES work, but in a multi-user environment, I > would consider > this fairly drastic. Of course, if my other option is to not > have a cache > at all > > > > > > |-+---> > | | "Scott Howlett" | > | | <[EMAIL PROTECTED]| > | | .com> | > | | | > | | 04/01/2003 01:40| > | | PM | > | | Please respond | > | | to "OJB Users | > | | List" | > | | | > |-+---> > > >- > -- > -----------| > | > > | > |To: "OJB Users List" <[EMAIL PROTECTED]> > > | > |cc: > > | > |Subject: RE: Default Cache - bug? design > catostrophe? user error? > | > | > > | > > >- > -- > ---| > > > > Could you flush the cache whenever you rollback a transaction? > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 1:37 PM > To: [EMAIL PROTECTED] > Subject: Default Cache - bug? design catostrophe? user error? > > > Consider this: I'm uing ObjectCacheDefaultImpl > > 1) I have an A which contains (has a reference to) a B. > 2) B has a name property. > 3) When I load A (oid=1), B(oid=2) gets loaded. > 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the > cache, and refers to B. B is in the cache). > 5) I begin a transaction, and lock B(2) into it so I can change it
Re: RE: Default Cache - bug? design catostrophe? user error?
David -- Have you tried setting refresh="true" for the reference-descriptor? If this is set, then when you retrieve object A, the reference to B will be refreshed. Based on the code that I reviewed, this refresh happens both when A is initially retrieved from the database and when it's pulled from the cache. Ron Gallagher Atlanta, GA [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > Date: 2003/04/02 Wed AM 08:11:15 EST > To: "OJB Users List" <[EMAIL PROTECTED]> > CC: "'OJB Users List'" <[EMAIL PROTECTED]> > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > It's not the transaction isolation that's a concern. I think the > PerBrokerCache has the same problem, which is that directly or indirectly, > the cache contains an invalid representation of what's in the database, > while there are no transactions in progress. > > > > > |-+> > | | Mahler Thomas| > | | <[EMAIL PROTECTED]| > | | ellium.com> | > | || > | | 04/02/2003 02:22 | > | | AM | > | | Please respond to| > | | "OJB Users List" | > | || > |-+> > > >--| > | > | > |To: "'OJB Users List'" <[EMAIL PROTECTED]> > | > | cc: > | > |Subject: RE: Default Cache - bug? design catostrophe? user error? > | > | > | > > >--| > > > > The DefaultCache is a global cache that does not isolate broker > transactions. > You can use other cache implementations (like the PerBrokerCache) that > isolate transactions. > > We hope get those issues fixed till 1.0 > > Thomas > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, April 01, 2003 9:28 PM > > To: OJB Users List > > Cc: OJB Users List > > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > > > > > > Well, that DOES work, but in a multi-user environment, I > > would consider > > this fairly drastic. Of course, if my other option is to not > > have a cache > > at all > > > > > > > > > > > > |-+---> > > | | "Scott Howlett" | > > | | <[EMAIL PROTECTED]| > > | | .com> | > > | | | > > | | 04/01/2003 01:40| > > | | PM | > > | | Please respond | > > | | to "OJB Users | > > | | List" | > > | | | > > |-+---> > > > > >- > > -- > > ---| > > | > > > > | > > |To: "OJB Users List" <[EMAIL PROTECTED]> > > > > | > > |cc: > > > > | > > |Subject: RE: Default Cache - bug? design > > catostrophe? user error? > > | > > | > > > > | > > > > >- > > -- > >
RE: Default Cache - bug? design catostrophe? user error?
It's not the transaction isolation that's a concern. I think the PerBrokerCache has the same problem, which is that directly or indirectly, the cache contains an invalid representation of what's in the database, while there are no transactions in progress. |-+> | | Mahler Thomas| | | <[EMAIL PROTECTED]| | | ellium.com> | | || | | 04/02/2003 02:22 | | | AM | | | Please respond to| | | "OJB Users List" | | || |-+> >--| | | |To: "'OJB Users List'" <[EMAIL PROTECTED]> | |cc: | | Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| The DefaultCache is a global cache that does not isolate broker transactions. You can use other cache implementations (like the PerBrokerCache) that isolate transactions. We hope get those issues fixed till 1.0 Thomas > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 9:28 PM > To: OJB Users List > Cc: OJB Users List > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > > Well, that DOES work, but in a multi-user environment, I > would consider > this fairly drastic. Of course, if my other option is to not > have a cache > at all > > > > > > |-+---> > | | "Scott Howlett" | > | | <[EMAIL PROTECTED]| > | | .com> | > | | | > | | 04/01/2003 01:40| > | | PM | > | | Please respond | > | | to "OJB Users | > | | List" | > | | | > |-+---> > > >- > -- > -------| > | > > | > |To: "OJB Users List" <[EMAIL PROTECTED]> > > | > |cc: > > | > |Subject: RE: Default Cache - bug? design > catostrophe? user error? > | > | > > | > > >- > -- > ---| > > > > Could you flush the cache whenever you rollback a transaction? > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 1:37 PM > To: [EMAIL PROTECTED] > Subject: Default Cache - bug? design catostrophe? user error? > > > Consider this: I'm uing ObjectCacheDefaultImpl > > 1) I have an A which contains (has a reference to) a B. > 2) B has a name property. > 3) When I load A (oid=1), B(oid=2) gets loaded. > 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the > cache, and refers to B. B is in the cache). > 5) I begin a transaction, and lock B(2) into it so I can change it's > name. > 6) I change it's name. > 7) Something happens, and the transaction is rolled back. > 8) B gets flushed from the cache, because the name it has is now > invalid. { A(1)[B(2)] } (A is in the cache and refers to B). > 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } > > B and B' now refer to the same logical object (oid=2), but they have
RE: Default Cache - bug? design catostrophe? user error?
The DefaultCache is a global cache that does not isolate broker transactions. You can use other cache implementations (like the PerBrokerCache) that isolate transactions. We hope get those issues fixed till 1.0 Thomas > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 9:28 PM > To: OJB Users List > Cc: OJB Users List > Subject: RE: Default Cache - bug? design catostrophe? user error? > > > > Well, that DOES work, but in a multi-user environment, I > would consider > this fairly drastic. Of course, if my other option is to not > have a cache > at all > > > > > > |-+---> > | | "Scott Howlett" | > | | <[EMAIL PROTECTED]| > | | .com> | > | | | > | | 04/01/2003 01:40| > | | PM | > | | Please respond | > | | to "OJB Users | > | | List" | > | | | > |-+---> > > >- > -- > ---| > | > > | > |To: "OJB Users List" <[EMAIL PROTECTED]> > > | > | cc: > > | > |Subject: RE: Default Cache - bug? design > catostrophe? user error? > | > | > > | > > >- > -- > ---| > > > > Could you flush the cache whenever you rollback a transaction? > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 1:37 PM > To: [EMAIL PROTECTED] > Subject: Default Cache - bug? design catostrophe? user error? > > > Consider this: I'm uing ObjectCacheDefaultImpl > > 1) I have an A which contains (has a reference to) a B. > 2) B has a name property. > 3) When I load A (oid=1), B(oid=2) gets loaded. > 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the > cache, and refers to B. B is in the cache). > 5) I begin a transaction, and lock B(2) into it so I can change it's > name. > 6) I change it's name. > 7) Something happens, and the transaction is rolled back. > 8) B gets flushed from the cache, because the name it has is now > invalid. { A(1)[B(2)] } (A is in the cache and refers to B). > 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } > > B and B' now refer to the same logical object (oid=2), but they have > different name values. Depending on how I happen to access the code > (direct load of B vs. asking A for it's B), I get two > entirely different > results. > > This seems to me like a *very* serious problem. The only solution I > can > see (and it is not without consequences) is to not cache the actual > object, but to cache the columnar data for the object, and then > reconstruct the object "on demand". > > David > > > > This message contains information from Equifax Inc. which may be > confidential and privileged. If you are not an intended recipient, > please refrain from any disclosure, copying, distribution or > use of this > information and note that such actions are prohibited. If you have > received this transmission in error, please notify by e-mail > [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
I'm familiar with these options. But my point is that I find it hard to believe that this is the way people expect OJB to behave. I don't want to isolate transactions, but I do want data consistency. David |-+---> | | "Jacob Hookom" | | | <[EMAIL PROTECTED]| | | du> | | | | | | 04/01/2003 02:44| | | PM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--| | | |To: "'OJB Users List'" <[EMAIL PROTECTED]> | |cc: | |Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| There are multiple Cache options that offer different scopes for transactions, along with PersistenceBrokers. You should look at the API for options on concurrency and transaction isolation with changing the previously stated items in the OJB.properties. -Jacob | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] | Sent: Tuesday, April 01, 2003 12:37 PM | To: [EMAIL PROTECTED] | Subject: Default Cache - bug? design catostrophe? user error? | | Consider this: I'm uing ObjectCacheDefaultImpl | | 1) I have an A which contains (has a reference to) a B. | 2) B has a name property. | 3) When I load A (oid=1), B(oid=2) gets loaded. | 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the cache, | and refers to B. B is in the cache). | 5) I begin a transaction, and lock B(2) into it so I can change it's name. | 6) I change it's name. | 7) Something happens, and the transaction is rolled back. | 8) B gets flushed from the cache, because the name it has is now invalid. | { A(1)[B(2)] } (A is in the cache and refers to B). | 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } | | B and B' now refer to the same logical object (oid=2), but they have | different name values. Depending on how I happen to access the code | (direct load of B vs. asking A for it's B), I get two entirely different | results. | | This seems to me like a *very* serious problem. The only solution I can | see (and it is not without consequences) is to not cache the actual | object, | but to cache the columnar data for the object, and then reconstruct the | object "on demand". | | David | | | | This message contains information from Equifax Inc. which may be | confidential and privileged. If you are not an intended recipient, please | refrain from any disclosure, copying, distribution or use of this | information and note that such actions are prohibited. If you have | received this transmission in error, please notify by e-mail | [EMAIL PROTECTED] | | | | - | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
There are multiple Cache options that offer different scopes for transactions, along with PersistenceBrokers. You should look at the API for options on concurrency and transaction isolation with changing the previously stated items in the OJB.properties. -Jacob | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] | Sent: Tuesday, April 01, 2003 12:37 PM | To: [EMAIL PROTECTED] | Subject: Default Cache - bug? design catostrophe? user error? | | Consider this: I'm uing ObjectCacheDefaultImpl | | 1) I have an A which contains (has a reference to) a B. | 2) B has a name property. | 3) When I load A (oid=1), B(oid=2) gets loaded. | 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the cache, | and refers to B. B is in the cache). | 5) I begin a transaction, and lock B(2) into it so I can change it's name. | 6) I change it's name. | 7) Something happens, and the transaction is rolled back. | 8) B gets flushed from the cache, because the name it has is now invalid. | { A(1)[B(2)] } (A is in the cache and refers to B). | 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } | | B and B' now refer to the same logical object (oid=2), but they have | different name values. Depending on how I happen to access the code | (direct load of B vs. asking A for it's B), I get two entirely different | results. | | This seems to me like a *very* serious problem. The only solution I can | see (and it is not without consequences) is to not cache the actual | object, | but to cache the columnar data for the object, and then reconstruct the | object "on demand". | | David | | | | This message contains information from Equifax Inc. which may be | confidential and privileged. If you are not an intended recipient, please | refrain from any disclosure, copying, distribution or use of this | information and note that such actions are prohibited. If you have | received this transmission in error, please notify by e-mail | [EMAIL PROTECTED] | | | | - | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
Well, that DOES work, but in a multi-user environment, I would consider this fairly drastic. Of course, if my other option is to not have a cache at all |-+---> | | "Scott Howlett" | | | <[EMAIL PROTECTED]| | | .com> | | | | | | 04/01/2003 01:40| | | PM | | | Please respond | | | to "OJB Users | | | List" | | | | |-+---> >--| | | |To: "OJB Users List" <[EMAIL PROTECTED]> | |cc: | |Subject: RE: Default Cache - bug? design catostrophe? user error? | | | >--| Could you flush the cache whenever you rollback a transaction? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 1:37 PM To: [EMAIL PROTECTED] Subject: Default Cache - bug? design catostrophe? user error? Consider this: I'm uing ObjectCacheDefaultImpl 1) I have an A which contains (has a reference to) a B. 2) B has a name property. 3) When I load A (oid=1), B(oid=2) gets loaded. 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the cache, and refers to B. B is in the cache). 5) I begin a transaction, and lock B(2) into it so I can change it's name. 6) I change it's name. 7) Something happens, and the transaction is rolled back. 8) B gets flushed from the cache, because the name it has is now invalid. { A(1)[B(2)] } (A is in the cache and refers to B). 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } B and B' now refer to the same logical object (oid=2), but they have different name values. Depending on how I happen to access the code (direct load of B vs. asking A for it's B), I get two entirely different results. This seems to me like a *very* serious problem. The only solution I can see (and it is not without consequences) is to not cache the actual object, but to cache the columnar data for the object, and then reconstruct the object "on demand". David This message contains information from Equifax Inc. which may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e-mail [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
i agree this is a problem. the OTM is designed to solve this problem. Oleg, Raghu and I are working on this (mostly Oleg :)) m -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 10:37 AM To: [EMAIL PROTECTED] Subject: Default Cache - bug? design catostrophe? user error? Consider this: I'm uing ObjectCacheDefaultImpl 1) I have an A which contains (has a reference to) a B. 2) B has a name property. 3) When I load A (oid=1), B(oid=2) gets loaded. 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the cache, and refers to B. B is in the cache). 5) I begin a transaction, and lock B(2) into it so I can change it's name. 6) I change it's name. 7) Something happens, and the transaction is rolled back. 8) B gets flushed from the cache, because the name it has is now invalid. { A(1)[B(2)] } (A is in the cache and refers to B). 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } B and B' now refer to the same logical object (oid=2), but they have different name values. Depending on how I happen to access the code (direct load of B vs. asking A for it's B), I get two entirely different results. This seems to me like a *very* serious problem. The only solution I can see (and it is not without consequences) is to not cache the actual object, but to cache the columnar data for the object, and then reconstruct the object "on demand". David This message contains information from Equifax Inc. which may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e-mail [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default Cache - bug? design catostrophe? user error?
Could you flush the cache whenever you rollback a transaction? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 1:37 PM To: [EMAIL PROTECTED] Subject: Default Cache - bug? design catostrophe? user error? Consider this: I'm uing ObjectCacheDefaultImpl 1) I have an A which contains (has a reference to) a B. 2) B has a name property. 3) When I load A (oid=1), B(oid=2) gets loaded. 4) Now the cache looks like this { A(1)[B(2)], B(2) } ( A is in the cache, and refers to B. B is in the cache). 5) I begin a transaction, and lock B(2) into it so I can change it's name. 6) I change it's name. 7) Something happens, and the transaction is rolled back. 8) B gets flushed from the cache, because the name it has is now invalid. { A(1)[B(2)] } (A is in the cache and refers to B). 9) I know load B(oid=2) and get B' The cache is { A(1)[B(2)] B'(2) } B and B' now refer to the same logical object (oid=2), but they have different name values. Depending on how I happen to access the code (direct load of B vs. asking A for it's B), I get two entirely different results. This seems to me like a *very* serious problem. The only solution I can see (and it is not without consequences) is to not cache the actual object, but to cache the columnar data for the object, and then reconstruct the object "on demand". David This message contains information from Equifax Inc. which may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e-mail [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]