Using Cayenne 2.0.3 ... I'm having problems when I use an accessor to get rows from a related table. It pulls fresh data the first time I use the accessor, but if data is modified outside of the Java application, it is not reflected the next time I use the accessor in a different execution stack within the same JVM.
List rowsA = context.performQuery(someQuery); ... SomeTable dataSetA = rowA.getRelatedRows(); //object rowA and dataSetA and someQuery pass out of scope ... //Data is Modified directly on the database, not in Java application ... List rowsB = context.performQuery(theSameQuery); ... SomeTable expectedModifiedButGotSetA = rowB.getRelatedRows(); The primary key which the relation uses to get the related data doesn't change from rowsA to rowsB. We're looking at the same related rowset, just updated data. I would like to know what is the magic no-cache recipe to force that particular accessor to always pull fresh data from the database... It appears that SelectQuery doesn't suffer from the same problem. I'm sure there's some configuration switches that I can trip, but there are several places caching policies can be modified and several confusingly similar yet different options to choose from.
