Wrong compare conditions changed.
Problem:
( NULL == conn ) && ( NULL == pObject )  && ( NULL != pSession )

The problem in the construction above are the first two conditions, which compares "equal" instead of "not equal".