Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
1012 | minor | always | 03-23-06 15:54 | 04-04-06 16:19 | |
|
|||||
Reporter: | ferg | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | high | OS Version: | |||
Status: | closed | Product Version: | 3.0.18 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.19 | ||
|
|||||
Summary: | 0001012: findByPrimaryKey with cached data | ||||
Description: |
(rep by Christian Amott) If I do a findByPrimaryKey on a bean that has been previously cached by resin and the cache period has expired, then resin will not actually do a re-load/select or check to see if it exists anymore until one of it's fields is accessed. It is only when something is done with one of it's fields or via cmr that an amber/ejb exception is thrown if the object has been removed from the db. Thus, the findByPrimaryKey method itself does not generate an ObjectNotFoundException if the object no longer exists and if the bean has been previously cached - but it will if it's the first time the key has been asked for and it's not cached. I am assuming that this is a bug ... or is this intended behaviour? eg. see attached .ejb file try { symbol = symbolHome.findByPrimaryKey(symbolId); } catch (FinderException e) { // if the object doesn't exist in the db then an objectnotfoundexception is only thrown *if* the bean specified by the key has not been cached previously by resin, *even if* the cache period has expired } String name = symbol.getLongName(); // if the symbol object no longer exists in the db and the cache period has expired, then this will cause an AmberObjectNotFoundException .... it's obviously incorrect for the findByPrimaryKey to not throw an exception if the object does not exist after the cache period has expired ... i need to be able to trap this. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|