/* if(getFieldName().equals("BTTM_DCD")){
System.out.println();
}
*/
if(instance==null) throw new UEngineException("Instance is null");
if("bpm_procinst".equalsIgnoreCase(getTableName()) && instance instanceof EJBProcessInstance){
dao = ((EJBProcessInstance)instance).getProcessInstanceDAO();
}else{
Object keyValue = ((EJBProcessInstance)instance).getProcessInstanceDAO().get(getCorrelatedFieldName());
String sharedContextKey = "DAO." + getTableName() + "@" + keyValue;
if(keyValue==null) throw new UEngineException("Database Synchronization Process Variable Exception: No value for correlation key [" + getCorrelatedFieldName() + "] of instance [" + instance.getInstanceId() + "]");
dao = (IDAO)instance.getProcessTransactionContext().getSharedContext(sharedContextKey);
if(dao==null){
String sql = "select * from " + getTableName() + " where " + getCorrelationFieldName() + "=?" + getCorrelationFieldName();