I have Company_Contacts with PK contain two objects Company and Users.
When i insert new company_contact row i use company_id and user_id which i get as parameter from my jsp form.
Then i want to show a whole list of my company_contacts, but the inserted line those not retrieves as i expect, i have some missing data.
i tried to debug and i realize that when i retrieve the list i get the same Company_Contacts_PK that was just inserted which is not fine.
it seems that the last object that i insert is saved in a place on the cache and not initialized from the DB as it should.
Code:
companyContactsDao.insertNewContact(companyContact s);
companyContactsList=companyContactsDao.getCompanyC ontacts(companyContacts.getCompanyContactsPK().get Company().getCmp_company_id());
actually companyContacts is not the same object but the PK class is the same on the memory.
Any Help