web stats
Database Reader - Select issue - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2009, 01:10 PM
ccitrano@tangible.com ccitrano@tangible.com is offline
OBX.3 Kenobi
 
Join Date: Apr 2008
Posts: 122
ccitrano@tangible.com
Default Database Reader - Select issue

Hello,

I'm using the database reader to pull information out of the database. Oddly, the following statements results in a error as soon as the channel is deployed. The second statement, with only one item in the select list works. The error generated is below. I'm obviously missing something simple ....

This statement fails
select [gid],[message]
from [message]
where
[statusid] = 102

This statement works
select [message]
from [message]
where
[statusid] = 102

Error Message:
[2009-09-02 16:06:21,918] ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: 7d1d3e78-2120-4ebe-a717-a56055f97ded: org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth .connectors.jdbc.JdbcConnector@1bf715e, endpointUri=jdbc://query, transformer=Transformer{name='ResultMapToXML', returnClass=false, returnClass=false, sourceTypes=[interface java.util.Map, class java.lang.String]}, name='_jdbcEndpoint#-1325612351', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon fig@16f7aea, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: org.apache.commons.dbutils.BasicRowProcessor$CaseI nsensitiveHashMap
org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth .connectors.jdbc.JdbcConnector@1bf715e, endpointUri=jdbc://query, transformer=Transformer{name='ResultMapToXML', returnClass=false, returnClass=false, sourceTypes=[interface java.util.Map, class java.lang.String]}, name='_jdbcEndpoint#-1325612351', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon fig@16f7aea, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: org.apache.commons.dbutils.BasicRowProcessor$CaseI nsensitiveHashMap
at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:64)
at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:83)
at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:235)
at com.webreach.mirth.connectors.jdbc.JdbcMessageRece iver.processMessage(JdbcMessageReceiver.java:168)
at org.mule.providers.TransactedPollingMessageReceive r$1.doInTransaction(TransactedPollingMessageReceiv er.java:98)
at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:72)
at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:104)
at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:90)
at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
at java.lang.Thread.run(Unknown Source)Caused by: org.mule.umo.transformer.TransformerException: Failed to parse result map
at com.webreach.mirth.server.mule.transformers.Result MapToXML.doTransform(ResultMapToXML.java:110)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
... 13 more
__________________
Chuck Citrano
ccitrano at tangible.com
[url][/http://www.tangible.comurl]
Reply With Quote
  #2  
Old 09-02-2009, 02:38 PM
ccitrano@tangible.com ccitrano@tangible.com is offline
OBX.3 Kenobi
 
Join Date: Apr 2008
Posts: 122
ccitrano@tangible.com
Default

Additional info ... I was able to get this to work by using the following query

select
[gid],
cast([message] as varchar(5000)) as message
from [message]
where
[statusid] = 102

message is defined as a nvarchar(max). It seems that something get's wierd when one column is defined with a max length. I am able to query 2 or more columns as long as none of the columns in the select list have 'max' defined as the field length.

Thanks.
Chuck.
__________________
Chuck Citrano
ccitrano at tangible.com
[url][/http://www.tangible.comurl]
Reply With Quote
  #3  
Old 09-02-2009, 11:10 PM
arpanmakwana arpanmakwana is offline
What's HL7?
 
Join Date: Aug 2009
Posts: 1
arpanmakwana is on a distinguished road
Send a message via Skype™ to arpanmakwana
Smile Thank you

Thanks a lot......

It really helped me.......
Reply With Quote
  #4  
Old 04-07-2011, 04:20 AM
Dagan Dagan is offline
OBX.2 Kenobi
 
Join Date: Jun 2009
Posts: 60
Dagan is on a distinguished road
Default

This is the best forum in the world!! jaja, thanks a lot, this really helped me a lot. I have been 2 days with this problem with no solution until I found this post.
Reply With Quote
  #5  
Old 07-10-2012, 07:55 AM
ffowler ffowler is offline
OBX.1 Kenobi
 
Join Date: May 2011
Posts: 50
ffowler is on a distinguished road
Default

Four years later and this thread is still good. Thanks for sharing that tip. Worked for me.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:30 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation