JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-3496

Expressions in JDBC Queries are not evaluated

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Patch submission Patch submission
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Incomplete
  • Affects Version/s: 2.0.1
  • Fix Version/s: 2.0.x Backlog
  • Component/s: Transport: JDBC
  • Labels:
    None
  • Includes test case?:
    no
  • User impact:
    High
  • Configuration:
    Hide
    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
    	xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
    	xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.0"
    	xsi:schemaLocation="
                   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                   http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
                   http://www.mulesource.org/schema/mule/jdbc/2.0 http://www.mulesource.org/schema/mule/jdbc/2.0/mule-jdbc.xsd
                   http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
                   http://www.mulesource.org/schema/mule/stdio/2.0 http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
                   ">
    
    	<description>This is a template.</description>
    
    	<spring:beans>
    		<spring:import resource="spring-applicationContext.xml" />
    	</spring:beans>
    
    	<vm:connector name="vmConnector" queueEvents="false" />
    	<jdbc:connector name="jdbcConnector" dataSource-ref="driverManagedDataSource">
    		<jdbc:query key="getFoo1" value="SELECT * from foo WHERE age=23 AND status=${header:status}"/>
    	</jdbc:connector>
    
    	<model name="testModel">
    		<service name="testService">
    			<inbound>
    				<vm:inbound-endpoint path="in" connector-ref="vmConnector" />
    			</inbound>
    			<component class="components.JdbcComponent"></component>
    			<outbound>
    				<outbound-pass-through-router>
    					<stdio:outbound-endpoint system="OUT" />
    				</outbound-pass-through-router>
    			</outbound>
    		</service>
    	</model>
    </mule>
    Show
    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
    	xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
    	xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.0"
    	xsi:schemaLocation="
                   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                   http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
                   http://www.mulesource.org/schema/mule/jdbc/2.0 http://www.mulesource.org/schema/mule/jdbc/2.0/mule-jdbc.xsd
                   http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
                   http://www.mulesource.org/schema/mule/stdio/2.0 http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
                   ">
    
    	<description>This is a template.</description>
    
    	<spring:beans>
    		<spring:import resource="spring-applicationContext.xml" />
    	</spring:beans>
    
    	<vm:connector name="vmConnector" queueEvents="false" />
    	<jdbc:connector name="jdbcConnector" dataSource-ref="driverManagedDataSource">
    		<jdbc:query key="getFoo1" value="SELECT * from foo WHERE age=23 AND status=${header:status}"/>
    	</jdbc:connector>
    
    	<model name="testModel">
    		<service name="testService">
    			<inbound>
    				<vm:inbound-endpoint path="in" connector-ref="vmConnector" />
    			</inbound>
    			<component class="components.JdbcComponent"></component>
    			<outbound>
    				<outbound-pass-through-router>
    					<stdio:outbound-endpoint system="OUT" />
    				</outbound-pass-through-router>
    			</outbound>
    		</service>
    	</model>
    </mule>
  • Similar Issues:
    None

Description

I have a component which reads from a JDBC query, by passing in a message with headers (i.e. in the example below, "status"):

public Object onCall(MuleEventContext eventContext) throws Exception {
	EndpointURI uri = new MuleEndpointURI("jdbc://getFoo1");
	MuleMessage response = eventContext.sendEvent(eventContext.getMessage(), uri);
	Object result = response.getPayload();

	return result;
}

It's not evaluated, see patch.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    DIFF
    30/Jun/08 06:17 AM
    0.7 kB
    Yuen-Chi Lian
  2. File
    JdbcConnector.class
    30/Jun/08 06:18 AM
    10 kB
    Yuen-Chi Lian
  3. Java Source File
    JdbcConnector.java
    30/Jun/08 06:18 AM
    11 kB
    Yuen-Chi Lian

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Yuen-Chi Lian made changes - 30/Jun/08 06:17 AM
Field Original Value New Value
Attachment DIFF [ 11713 ]
Yuen-Chi Lian made changes - 30/Jun/08 06:18 AM
Attachment JdbcConnector.class [ 11714 ]
Yuen-Chi Lian made changes - 30/Jun/08 06:18 AM
Attachment JdbcConnector.java [ 11715 ]
Yuen-Chi Lian made changes - 30/Jun/08 06:24 AM
Summary Expression in JDBC Queries are not evaluated Expressions in JDBC Queries are not evaluated
Andrew Perepelytsya made changes - 30/Jun/08 09:37 AM
Affects Version/s 2.0.1 [ 10266 ]
Configuration <?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.0"
xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
               http://www.mulesource.org/schema/mule/jdbc/2.0 http://www.mulesource.org/schema/mule/jdbc/2.0/mule-jdbc.xsd
               http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
               http://www.mulesource.org/schema/mule/stdio/2.0 http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
               ">

<description>This is a template.</description>

<spring:beans>
<spring:import resource="spring-applicationContext.xml" />
</spring:beans>

<vm:connector name="vmConnector" queueEvents="false" />
<jdbc:connector name="jdbcConnector" dataSource-ref="driverManagedDataSource">
<jdbc:query key="getFoo1" value="SELECT * from foo WHERE age=23 AND status=${header:status}"/>
</jdbc:connector>

<model name="testModel">
<service name="testService">
<inbound>
<vm:inbound-endpoint path="in" connector-ref="vmConnector" />
</inbound>
<component class="components.JdbcComponent"></component>
<outbound>
<outbound-pass-through-router>
<stdio:outbound-endpoint system="OUT" />
</outbound-pass-through-router>
</outbound>
</service>
</model>
</mule>
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.0"
xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
               http://www.mulesource.org/schema/mule/jdbc/2.0 http://www.mulesource.org/schema/mule/jdbc/2.0/mule-jdbc.xsd
               http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
               http://www.mulesource.org/schema/mule/stdio/2.0 http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
               ">

<description>This is a template.</description>

<spring:beans>
<spring:import resource="spring-applicationContext.xml" />
</spring:beans>

<vm:connector name="vmConnector" queueEvents="false" />
<jdbc:connector name="jdbcConnector" dataSource-ref="driverManagedDataSource">
<jdbc:query key="getFoo1" value="SELECT * from foo WHERE age=23 AND status=${header:status}"/>
</jdbc:connector>

<model name="testModel">
<service name="testService">
<inbound>
<vm:inbound-endpoint path="in" connector-ref="vmConnector" />
</inbound>
<component class="components.JdbcComponent"></component>
<outbound>
<outbound-pass-through-router>
<stdio:outbound-endpoint system="OUT" />
</outbound-pass-through-router>
</outbound>
</service>
</model>
</mule>
{code}
Affects Version/s 2.0.2 [ 10267 ]
Issue Type Bug [ 1 ] Patch submission [ 5 ]
Daniel Feist made changes - 01/Jul/08 07:52 PM
Fix Version/s 2.0.x Backlog [ 10352 ]
Dirk Olmes made changes - 03/Jul/08 04:52 AM
Priority To be reviewed [ 6 ] Minor [ 4 ]
Includes test case? [no]
Dirk Olmes made changes - 03/Jul/08 04:52 AM
Status Open [ 1 ] Closed [ 6 ]
Resolution Incomplete [ 4 ]

People

  • Assignee:
    Unassigned
    Reporter:
    Yuen-Chi Lian
Vote (0)
Watch (0)

Dates

  • Created:
    30/Jun/08 06:16 AM
    Updated:
    03/Jul/08 04:52 AM
    Resolved:
    03/Jul/08 04:52 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.