Announcement

Collapse
No announcement yet.

Error Data Truncated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error Data Truncated

    I have searched the threads for an answer to the deli-ma that I face. I am a novice when it come to java object oriented programming. So there are may things I do not understand yet. I hope to post enough information here to resolve the problem with the system. There has been a channel built. It writes to a file just fine. But after doing the mappings to write the same channel to the database. I get the error below.

    Code:
      [2013-01-27 16:16:54,971]  ERROR (org.mule.impl.DefaultExceptionStrategy:231): 
    ********************************************************************************
    Message          : 
    CHANNEL:
    	Sherwin_Channel
    CONNECTOR:
    	sourceConnector
    SCRIPT SOURCE:
    	
    SOURCE CODE:
    	
    256: 
    	
    	"VALUES('"+Lab_Order_ID+"','"+speObservationDateTime+"','"+speObservationEndDateTime+"','"+speCollectionVolume+"',"+
    257: 
    	
    	"'"+speCollectorIdentifier+"','"+speSpecimenActionCode+"','"+speDangerCode+"','"+speReleventClinicalInfo+"',"+
    258: 
    	
    	"'"+speSpecimenReceivedDateTime+"','"+speSpecimenSource+"','"+speScheduledDateTime+"','"+speSampleContainers+"',"+
    259: 
    	
    	"'"+speTransportLogisticsCollectedSample+"','"+speCollectorsComment+"','"+speTransportArrangementResponsibility+"','"+speTransportArranged+"',"+
    260: 
    	
    	"'"+speEscortArranged+"','"+spePlannedPatientTransportComment+"');"
    261: 
    	
    	res = dbConn.executeUpdate(query);
    262: 
    263: 
    264:    
    	
    	obxCount = 0;
    265:    
    	
    	index = msg['OBR'][i].childIndex();
    LINE NUMBER:
    	261
    DETAILS:
    	Wrapped java.sql.SQLException: Data truncated for column 'Specimen_Action_Code' at row 1 (com.webreach.mirth.server.MirthJavascriptTransformerException)
    Type             : org.mule.umo.transformer.TransformerException
    Code             : 64999
    JavaDoc          : http://mule.codehaus.org/docs/apidocs/org/mule/umo/transformer/TransformerException.html
    Transformer      : Transformer{name='c91c1d9b-05bc-43c9-86d9-d87c593b1f31_source_transformer', returnClass=false, returnClass=false, sourceTypes=[]}
    ********************************************************************************
    Exception stack is:
    1. Data truncated for column 'Specimen_Action_Code' at row 1 (java.sql.SQLException)
      com.mysql.jdbc.SQLError:946 (null)
    2. 
    CHANNEL:
    	Sherwin_Channel
    CONNECTOR:
    	sourceConnector
    SCRIPT SOURCE:
    	
    SOURCE CODE:
    	
    256: 
    	
    	"VALUES('"+Lab_Order_ID+"','"+speObservationDateTime+"','"+speObservationEndDateTime+"','"+speCollectionVolume+"',"+
    257: 
    	
    	"'"+speCollectorIdentifier+"','"+speSpecimenActionCode+"','"+speDangerCode+"','"+speReleventClinicalInfo+"',"+
    258: 
    	
    	"'"+speSpecimenReceivedDateTime+"','"+speSpecimenSource+"','"+speScheduledDateTime+"','"+speSampleContainers+"',"+
    259: 
    	
    	"'"+speTransportLogisticsCollectedSample+"','"+speCollectorsComment+"','"+speTransportArrangementResponsibility+"','"+speTransportArranged+"',"+
    260: 
    	
    	"'"+speEscortArranged+"','"+spePlannedPatientTransportComment+"');"
    261: 
    	
    	res = dbConn.executeUpdate(query);
    262: 
    263: 
    264:    
    	
    	obxCount = 0;
    265:    
    	
    	index = msg['OBR'][i].childIndex();
    LINE NUMBER:
    	261
    DETAILS:
    	Wrapped java.sql.SQLException: Data truncated for column 'Specimen_Action_Code' at row 1 (com.webreach.mirth.server.MirthJavascriptTransformerException)
      org.mozilla.javascript.Context:1781 (null)
    3. 
    CHANNEL:
    	Sherwin_Channel
    CONNECTOR:
    	sourceConnector
    SCRIPT SOURCE:
    	
    SOURCE CODE:
    	
    256: 
    	
    	"VALUES('"+Lab_Order_ID+"','"+speObservationDateTime+"','"+speObservationEndDateTime+"','"+speCollectionVolume+"',"+
    257: 
    	
    	"'"+speCollectorIdentifier+"','"+speSpecimenActionCode+"','"+speDangerCode+"','"+speReleventClinicalInfo+"',"+
    258: 
    	
    	"'"+speSpecimenReceivedDateTime+"','"+speSpecimenSource+"','"+speScheduledDateTime+"','"+speSampleContainers+"',"+
    259: 
    	
    	"'"+speTransportLogisticsCollectedSample+"','"+speCollectorsComment+"','"+speTransportArrangementResponsibility+"','"+speTransportArranged+"',"+
    260: 
    	
    	"'"+speEscortArranged+"','"+spePlannedPatientTransportComment+"');"
    261: 
    	
    	res = dbConn.executeUpdate(query);
    262: 
    263: 
    264:    
    	
    	obxCount = 0;
    265:    
    	
    	index = msg['OBR'][i].childIndex();
    LINE NUMBER:
    	261
    DETAILS:
    	Wrapped java.sql.SQLException: Data truncated for column 'Specimen_Action_Code' at row 1 (com.webreach.mirth.server.MirthJavascriptTransformerException) (org.mule.umo.transformer.TransformerException)
      com.webreach.mirth.server.mule.transformers.JavaScriptTransformer:470 (http://mule.codehaus.org/docs/apidocs/org/mule/umo/transformer/TransformerException.html)
    ********************************************************************************
    Root Exception stack trace:
    java.sql.SQLException: Data truncated for column 'Specimen_Action_Code' at row 1
    
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
    
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
    
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
    
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
    
    	at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
    
    	at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
    
    	at com.mysql.jdbc.Statement.execute(Statement.java:727)
    
    	at com.webreach.mirth.server.util.DatabaseConnection.executeUpdate(DatabaseConnection.java:148)
    
    	at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    
    	at java.lang.reflect.Method.invoke(Method.java:597)
    
    	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
    
    	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
    
    	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62._c_doTransform_14(2594c164-73d5-4669-8862-b66d0360933a:261)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62.call(2594c164-73d5-4669-8862-b66d0360933a)
    
    	at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62._c_script_0(2594c164-73d5-4669-8862-b66d0360933a:476)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62.call(2594c164-73d5-4669-8862-b66d0360933a)
    
    	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
    
    	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62.call(2594c164-73d5-4669-8862-b66d0360933a)
    
    	at org.mozilla.javascript.gen._2594c164_73d5_4669_8862_b66d0360933a_62.exec(2594c164-73d5-4669-8862-b66d0360933a)
    
    	at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.evaluateScript(JavaScriptTransformer.java:403)
    
    	at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.transform(JavaScriptTransformer.java:356)
    
    	at org.mule.transformers.AbstractEventAwareTransformer.doTransform(AbstractEventAwareTransformer.java:48)
    
    	at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197)
    
    	at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:200)
    
    	at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251)
    
    	at org.mule.routing.inbound.SelectiveConsumer.isMatch(SelectiveConsumer.java:61)
    
    	at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:83)
    
    	at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:493)
    
    	at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:272)
    
    	at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:231)
    
    	at com.webreach.mirth.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:207)
    
    	at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108)
    
    	at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:90)
    
    	at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
    
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    
    	at java.lang.Thread.run(Thread.java:662)
    
    ********************************************************************************
    Step 0 under Channel Transformer is setup with this java script:


    I have done 73 other mappings to the database. Does the Java script above do everything that the 73 other mappings that I have done. Or do I need the mappings and the java script above?

    My apologies that I could not ask more intelligent question and that a kind hearted person would answer to point me in the right direction. If there is any additional information that you need to answer my question just ask. I will gladly post it.

  • #2
    Hi,
    it seems an error strictly related to your insert query, and it occurs because you are trying to insert inside the table a Specimen_action_code that exceeds the maximum length allowed by the table column. While you tried to print all values in a file before and all went well (if I understood correctly) you could check all Specimen action codes in order to understand which one is causing the problem. You can also insert some log rows inside your transformer codes in order to check sql query syntax (with real values).

    Hope this helps, best regards
    Alessandro

    Comment


    • #3
      Alessandro,

      Thanks for that pointer. It helps. I went and looked at the database and the Length value for that table is something that I am unfamiliar with. 'A','G','L','O','P','R','S','' are the values. I am not sure what to do with this. Usually the value is a number. I am trying to figure out what someone else has done. Thanks for your help.

      Sherwin

      Comment

      Working...
      X