Summary on 2008-06-12: How to check one session is valid

1. before invalidate the session, it's necessary to check whether the session is still valid,

HttpServletRequest supply one method called: isRequestedSessionIdValid()

this method will check whether the current session is still valid, and if yes, return true, else, return false.

2. For the use of 'Set' in hibernate.

if one POJO has one set and the cascade has been set to 'true' in the hibernate mapping file

so for one POJO, let's say, there is instance O1 and O2 in the set. while in usage, if we reset the 'Set' with one new set, and add O1 and O2 into the set, and save/update the POJO. what's the process of save the set? you should be surprised to see the process is that: 1. delete O1 and O2 from db 2. save O1 and O2 to db.

so that's the process of handling the 'Set' in hibernate.

你可能感兴趣的:(Work,Summary,session,hibernate,delete)