Page 1 of 1

Не сохраняется элемент из multiple list с пробелом впереди

PostPosted: Wed Nov 23, 2016 7:45 pm
by olegko
1. Создать кастомное поле типа multiple list
2. Добавить элемент в список, в названии которого впереди пробел.
3. Открыть задачу с этим полем, выбрать элемент с пробелом впереди и попробовать сохранить.
==> Задача не сохраняется, возвращается системная ошибка
Code: Select all
 System Information:
Java Information:
Java Version: 1.7.0_80
Java Vendor: Oracle Corporation
Java Specification Vendor: Oracle Corporation
Java Specification Version: 1.7
Java Home: c:\program files\common files\i4j_jres\1.7.0_80
Java Classpath: C:\TrackStudio-507\lib\mail.jar
Servlet Container Information:
Servlet Version: 25
AS Vendor: jetty/6.1.26
Virtual Machine Information:
VM Vendor: Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM
VM Version: 24.80-b11
Runtime Version: 1.7.0_80-b15
VM Specification Version: 1.7
VM Info: mixed mode
System information:
OS Name: amd64-Windows NT (unknown)(10.0)
Total Memory: 84049920
Free Memory: 11091080
Product Information:
Version: 5.0.7.20160822
Licensee: Evaluation Customer
License Type: EVAL
Database Information:
Database: HSQL Database Engine
Database version:2.2.8
Database major version:2
Database minor version:2
Database driver name:HSQL Database Engine Driver
Database driver version:2.2.8
Database driver major version:2
Database driver minor version:2
Hibernate Dialect: org.hibernate.dialect.HSQLDialect
Hibernate Driver: org.hsqldb.jdbcDriver
Expire Date: 1/7/47 5:33 AM
Stack Trace:
            org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:179)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
   at com.sun.proxy.$Proxy66.flush(Unknown Source)
   at com.trackstudio.kernel.lock.DBSession.commit(DBSession.java:38)
   at com.trackstudio.tools.HibernateUtil.cleanSession(HibernateUtil.java:117)
   at com.trackstudio.tools.HibernateUtil.createObject(HibernateUtil.java:104)
   at com.trackstudio.kernel.manager.UdfManager.setUdfValue(UdfManager.java:840)
   at com.trackstudio.kernel.manager.UdfManager.setTaskUdfValue(UdfManager.java:889)
   at com.trackstudio.securedkernel.SecuredUDFAdapterManager.setUdfValue(SecuredUDFAdapterManager.java:1221)
   at com.trackstudio.securedkernel.SecuredUDFAdapterManager.setMessageUDFValueSimple(SecuredUDFAdapterManager.java:1183)
   at com.trackstudio.secured.SecuredMessageTriggerBean.create(SecuredMessageTriggerBean.java:138)
   at com.trackstudio.app.TriggerManager.createMessage(TriggerManager.java:99)
   at com.trackstudio.action.task.MessageCreateAction.saveMessage(MessageCreateAction.java:419)
   at com.trackstudio.action.task.MessageCreateAction.save(MessageCreateAction.java:360)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
   at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
   at com.trackstudio.action.TSDispatchAction.execute(TSDispatchAction.java:75)
   at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
   at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
   at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
   at com.trackstudio.action.TSStrutsServlet.doGet(TSStrutsServlet.java:36)
   at com.trackstudio.action.TSStrutsServlet.doPost(TSStrutsServlet.java:44)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
   at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:130)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
   at com.trackstudio.filters.CompressResponseFilter.doFilter(CompressResponseFilter.java:64)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
   at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
   at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
   at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
   at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
   at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
   at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
   at org.mortbay.jetty.Server.handle(Server.java:326)
   at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
   at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
   at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
   at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.sql.BatchUpdateException: integrity constraint violation: foreign key no parent; FUDFVAL_1 table: GR_UDFVAL
   at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(Unknown Source)
   at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
   at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
   ... 64 more


P.S.: Пробелы впереди названий нужны, чтобы создать определённую сортировку (например, чтобы отсортировать названия дней недели по порядку).

Re: Не сохраняется элемент из multiple list с пробелом впере

PostPosted: Mon Nov 28, 2016 12:33 pm
by dpochtarev
Занес в трекер.

Re: Не сохраняется элемент из multiple list с пробелом впере

PostPosted: Tue Mar 20, 2018 10:00 pm
by dpochtarev
Исправлено в 550.
Поле можно отредактировать и сохранить или выполнить в базу запрос
update gr_udflist set udflist_val=trim(both ' ' from udflist_val)