cancel
Showing results for 
Search instead for 
Did you mean: 

Hibernate Exception Handling Japanese against SQL Server

hfrank
Champ in-the-making
Champ in-the-making
I run Alfresco tomcat bundle 1.4.0beta on windows 2003, sql server 2000. When I was trying to import a file named : (提出不要)mn-翻訳者用語リスト_翻訳コメント_10676982.txt, the following error occurred:
Either jtds-1.2.jar or msdriver.jar does not work. However, this file name can be handled correctly if I switched to mysql 5.0.
Any hints will be appreciated.
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute update query; uncategorized SQLException for SQL [update alf_child_assoc set child_node_name=?, child_node_name_crc=? where id=?]; SQL state [01004]; error code [0]; Data truncation; nested exception is java.sql.DataTruncation: Data truncation
java.sql.DataTruncation: Data truncation
   at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:379)
   at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
   at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
   at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
   at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525)
   at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487)
   at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
   at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
   at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75)
   at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:334)
   at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:209)
   at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1126)
   at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
   at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl$4.doInHibernate(HibernateNodeDaoServiceImpl.java:591)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
   at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.setChildNameUnique(HibernateNodeDaoServiceImpl.java:596)
   at sun.reflect.GeneratedMethodAccessor491.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(TransactionalDaoInterceptor.java:60)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy1.setChildNameUnique(Unknown Source)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.setChildUniqueName(DbNodeServiceImpl.java:1853)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.createNode(DbNodeServiceImpl.java:312)
   at sun.reflect.GeneratedMethodAccessor662.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:213)
   at $Proxy2.createNode(Unknown Source)
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.create(FileFolderServiceImpl.java:683)
   at sun.reflect.GeneratedMethodAccessor714.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:210)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:156)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:61)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy29.create(Unknown Source)
   at org.alfresco.filesys.smb.server.repo.CifsHelper.createNode(CifsHelper.java:355)
   at org.alfresco.filesys.smb.server.repo.ContentDiskDriver.createFile(ContentDiskDriver.java:1230)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.procNTCreateAndX(NTProtocolHandler.java:5292)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.runProtocol(NTProtocolHandler.java:305)
   at org.alfresco.filesys.smb.server.SMBSrvSession.runHandler(SMBSrvSession.java:1662)
   at org.alfresco.filesys.smb.server.SMBSrvSession.run(SMBSrvSession.java:1563)
   at java.lang.Thread.run(Thread.java:595)
3 REPLIES 3

derek
Star Contributor
Star Contributor
Hi,

Try manually increasing the size of the child_node_name column in alf_child_assoc.

Regards

hfrank
Champ in-the-making
Champ in-the-making
Hi Derek,

It works.
Thank you for your help.

However, could you tell me why mysql5.0 works well even without this change ?

Best Regards

derek
Star Contributor
Star Contributor
What encoding are you using for the database?
What length did you assign to the column?