Petr wrote:Все правильно просто не надо делать обновления задачи. то есть task.update();
вы записали в базу и внутри kernal идет обновления кеша. так что все должно работать.
- Code: Select all
import com.trackstudio.kernel.manager.KernelManager;
String taskId = task.getId();
String Zaja = task.getUdfValue("Заявитель");
String udfId = CSVImport.findUDFIdByName("Заявитель");
String Nm = task.getHandler().getLogin();
String lc = sc.getLocale();
String tz = sc.getTimezone();
if (Zaja.equals("")) {
KernelManager.getUdf().setTaskUdfValue(udfId,taskId,Nm,lc,tz);
}
return task;
Не работает, при запуске под пользователем с правами выдает: com.trackstudio.exception.GranException: Could not execute JDBC batch update
из лога:
2010-08-13 16:43:57,961 ERROR org.hibernate.util.JDBCExceptionReporter:logExceptions:72 - Batch entry 0 insert into gr_udfval (udfval_str, udfval_num, udfval_dat, udfval_udflist, udfval_udf, udfval_udfsource, udfval_task, udfval_user, udfval_id) values (NULL, NULL, NULL, NULL, 8a485db02a12c0a8012a133dd10c0145, 8a485db02a6b7744012a6b7a5c3f0045, NULL, root, 8a485db02a6b7744012a6b7a66870073) was aborted. Call getNextException to see the cause.
2010-08-13 16:43:57,961 ERROR org.hibernate.util.JDBCExceptionReporter:logExceptions:72 - ERROR: insert or update on table "gr_udfval" violates foreign key constraint "fudfval_5"
Detail: Key (udfval_user)=(root) is not present in table "gr_user".
2010-08-13 16:43:57,962 ERROR org.hibernate.event.def.AbstractFlushingEventListener:performExecutions:300 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
При запуске под пользователем без прав, традиционное: java.lang.NullPointerException: Null Pointer in Method Invocation
Если дать права на поле, то: com.trackstudio.exception.GranException: Could not execute JDBC batch update
