Regarding Toplink Fetching Policy
Posted
by Chandu
on Stack Overflow
See other posts from Stack Overflow
or by Chandu
Published on 2010-04-21T10:04:34Z
Indexed on
2010/04/25
20:33 UTC
Read the original article
Hit count: 442
Hi,
I'm working for a Swing Project and the technologies used are netbeans with Toplink essentials, mysql.
The Problem I'm facing is the entity object dosn't get updated after insertions take place while calling a getter collection of the foreign key property.
Ex: I have 2 tables Table1,Table2. I have sno column, id column as a primary key in Table1 & is Foreign Key in Table2. Through find method I just get the particular sno object(existed in table 1) set some values persisted to table2 & committed the transaction.
When I select the same sno object through find method & gets its collection from Table2 through the getTable2Collection() of the bean(as it is already created in bean by toplink essential) I'm unable to get the latest added record except that all other records of it are displayed. After I close the application & opening it then the new record gets reflected while calling the same sno through the above process.
I came to know that this is a kind of lazy fetching and there should be some way of fetch policy to be changed to make the entity object get updated with the changes. So Please help me in this regard.
Regards,
Chandu
© Stack Overflow or respective owner