HI, I am having a problem. My (i am guessing) persistence layer is caching my results, so when i update the database from outside my application then the data is remaining stale.
however, it is only caching half the time, i hope this makes sense,
I have a class
@Entity
@Table(name = "PROVINCE")
public class Province implements Serializable {
@Id
@GeneratedValue
int id;
String provinceName;
String provinceMoto;
Buildings buildings;
Units units;
Person person;
.... etc
now, if i update any data that isn't an a reference to a class object, like the 'provincename' then the data is fine in my application and updates straight away. however, the inner objects like 'buildings' doesn't and i cannot figure out how to, if i do a hard refresh like redeploying my app, then the data is fresh.
i get my province from the database here:
Query query = manager.createQuery("select p from Province p where p.person = :query");
query.setHint("toplink.refresh", "true");
query.setParameter("query", p);
province = (Province) query.getSingleResult();
so how do i go about forcing that to also make the inner objects of that class, i.e. the 'buildings' 'person' to also update.
my persistence layer is toplink essentials, and i fixed my earlier problem which was no data updating. and that first post here(it's another stack overflow page)
thank yous for any helps. i hope i explained my problem well enough
[EDIT: like if i wasnt using this framework, it'd just be easier to join the tables in the db and repopulate the data in a new variable, but im not]