[ 
https://issues.apache.org/activemq/browse/SM-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39025
 ] 

Dejan Predovic commented on SM-936:
-----------------------------------

I need to check with my boss if that's ok, but I have to say I wouldn't really 
qualify it as "a good JDBC component". It's more "a JDBC component that does 
the job at the moment". :) 

Anyway, what the DbMapPoller takes the select statement from the configuration, 
executes it and generates a message per row. Messages are map-like in form:

<root>
   <columnName1>value</columnName1>
   <columnName2>value</columnName2>
   ...
</root>

messages in that form are send to an in-out target endpoint (usually a 
transformer). Out message must be in the same map-form, but the values are used 
as param values for the update or delete statement that needs to take care of 
the record so that it doesn't get selected again.


The config looks something like:

<sm:activationSpec component="sks:NaeRequestPoller"
                               service="sks:NaeRequestPoller"
                               destinationService="sks:NaeRequestRoutingSlip">
                <sm:component>
                    <bean class="de.einsundeins.crmb.servicemix.DbMapPoller">
                        <property name="selectSql">
                            <value>
                                select NAE_ESB_EXCHANGE_ID, ESB_MESSAGE_ID, 
SKS_ID, SIM_SERIALNUMBER
                                from SCHNITTSTELLE..NAE_ESB_EXCHANGE
                                where ESB_MESSAGE_STATE_ID = 10000
                            </value>
                        </property>
                        <property name="updateSql">
                            <value>
                                update SCHNITTSTELLE..NAE_ESB_EXCHANGE
                                set
                                TS_CHANGED=getdate(),
                                ESB_MESSAGE_STATE_ID = convert(int, :stateId),
                                REQUEST_ID = convert(int, :requestId),
                                RESPONSE = :response,
                                ERROR_MESSAGE = :errorMessage
                                where NAE_ESB_EXCHANGE_ID = :id
                            </value>
                        </property>
                        <property name="idSelectColumn" 
value="NAE_ESB_EXCHANGE_ID"/>
                        <property name="idUpdateParam" value="id"/>
                        <property name="rootName" value="sks"/>
                        <property name="delay" value="10000"/>
                        <property name="period" value="30000"/>
                        <property name="dataSource" ref="dataSource"/>
                        <property name="transactionManager" 
ref="transactionManager"/>
                    </bean>
                </sm:component>
            </sm:activationSpec>

Do you still want it? :)

> FilePoller component leaves the target endpoint in dirty state
> --------------------------------------------------------------
>
>                 Key: SM-936
>                 URL: https://issues.apache.org/activemq/browse/SM-936
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-file
>    Affects Versions: 3.1
>            Reporter: Dejan Predovic
>
> FilePoller invokes the target endpoint using simply sendSync(). Many 
> components require additional call to done() to ensure cleanup and resource 
> release. Any such component when invoked from FilePoller, FtpPoller (or any 
> other poller written on the basis of the two) will "leak".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to