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-761

JdbcMessageDispatcher failure when performing a query with null parameters

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.3.2
  • Component/s: Transport: JDBC
  • Labels:
    None
  • Environment:

    N/A

  • Log Output:
    Hide
     java.sql.SQLException: Invalid column type Query: INSERT INTO FPA.ESPECIES (rest of the query here)...

          at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:330)

          at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:399)

          at org.mule.providers.jdbc.JdbcMessageDispatcher.doDispatch(JdbcMessageDispatcher.java:98)

          at com.lumina.integration.mule.providers.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:61)

          at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:196)
    Show
     java.sql.SQLException: Invalid column type Query: INSERT INTO FPA.ESPECIES (rest of the query here)...       at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:330)       at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:399)       at org.mule.providers.jdbc.JdbcMessageDispatcher.doDispatch(JdbcMessageDispatcher.java:98)       at com.lumina.integration.mule.providers.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:61)       at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:196)
  • Similar Issues:
    None

Description

I'm trying to perform an insert on an Oracle Database. The problem I have is with null parameters to be passed to the statement.

The jdbc dispatcher performs a:

int nbRows = new QueryRunner().update(con, writeStmt, paramValues);

Looking at the QueryRunner code I can see that the update method invokes the fillStatement operation:

protected void fillStatement(PreparedStatement stmt, Object[] params) throws SQLException {

if (params == null) { return; }

for (int i = 0; i < params.length; i++) {

if (params[i] != null) { stmt.setObject(i + 1, params[i]); } else { stmt.setNull(i + 1, Types.OTHER); }

}

}

When a null value is found, the stmt.setNull(i + 1, Types.OTHER); is called and the following exception is thrown:

java.sql.SQLException: Invalid column type Query: INSERT INTO FPA.ESPECIES (rest of the query here)...

at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:330)

at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:399)

at org.mule.providers.jdbc.JdbcMessageDispatcher.doDispatch(JdbcMessageDispatcher.java:98)

at com.lumina.integration.mule.providers.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:61)

at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:196)

Apparently the error is because of the Types.OTHER sql type. I know that this is an issue involving Jakarta dbutils package but maybe someone has already got this problem and found a workaround to this.

At the Jakarta mailing list a workaround is mentioned by subclassing the QueryRunner class. In order to do that, I'll need to subclass the JDBC provider completely (the dispatcher and factory at least). Perhaps a custom QueryRunner could be injected to the JdbcMessageDispatcher in a future version.

Regards,

Juan Manuel

Issue Links

relates to

Improvement - An improvement or enhancement to an existing feature or task. MULE-491 Improve JdbcConnector to delegate calls to the ORM layer

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Task - A task that needs to be done. MULE-1244 Upgrade to commons-dbutils-1.1

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Travis Carlson made changes - 12/Apr/06 10:40 AM
Field Original Value New Value
Link This issue relates to MULE-491 [ MULE-491 ]
Travis Carlson made changes - 15/Aug/06 12:34 PM
Workflow No "Resolved" state [ 11892 ] No "Resolved" state, added "Pending 3rd-Party" state [ 12894 ]
Travis Carlson made changes - 15/Aug/06 12:46 PM
Workflow No "Resolved" state, added "Pending 3rd-Party" state [ 12894 ] No "Resolved" state [ 13871 ]
Travis Carlson made changes - 15/Aug/06 12:51 PM
Workflow No "Resolved" state [ 13871 ] No "Resolved" state, added "Pending 3rd-Party" state [ 14848 ]
Travis Carlson made changes - 15/Aug/06 01:15 PM
Assignee Travis Carlson [ tcarlson ]
Anonymous made changes - 16/Aug/06 12:45 AM
Status Open [ 1 ] Pending 3rd-Party [ 10000 ]
Anonymous made changes - 19/Aug/06 11:46 AM
Status Pending 3rd-Party [ 10000 ] Open [ 1 ]
Anonymous made changes - 19/Aug/06 06:43 PM
Status Open [ 1 ] Pending 3rd-Party [ 10000 ]
Andrew Perepelytsya made changes - 21/Aug/06 09:21 PM
Workflow No "Resolved" state, added "Pending 3rd-Party" state [ 14848 ] Broken > No "Resolved" state, added "Pending 3rd-Party" state [ 15841 ]
Andrew Perepelytsya made changes - 21/Aug/06 09:24 PM
Workflow Broken > No "Resolved" state, added "Pending 3rd-Party" state [ 15841 ] No "Resolved" state, added "Pending 3rd-Party" state [ 16834 ]
Holger Hoffstaette made changes - 22/Aug/06 02:34 AM
Status Pending 3rd-Party [ 10000 ] Open [ 1 ]
Ross Mason made changes - 08/Nov/06 06:46 AM
Assignee Travis Carlson [ tcarlson ] Alan Cassar [ alan.cassar ]
Alan Cassar made changes - 22/Nov/06 07:27 AM
Status Open [ 1 ] Closed [ 6 ]
Fix Version/s 1.3.2 [ 10230 ]
Resolution Fixed [ 1 ]
Holger Hoffstaette made changes - 23/Jan/07 04:42 AM
Link This issue relates to MULE-1244 [ MULE-1244 ]
Andrew Perepelytsya made changes - 18/May/07 09:14 AM
Workflow No "Resolved" state, added "Pending 3rd-Party" state [ 16834 ] Release Mode Workflow [ 19227 ]
Andrew Perepelytsya made changes - 18/May/07 09:17 AM
Workflow Release Mode Workflow [ 19227 ] No "Resolved" state, added "Pending 3rd-Party" state [ 20952 ]
Andrew Perepelytsya made changes - 18/May/07 09:22 AM
Workflow No "Resolved" state, added "Pending 3rd-Party" state [ 20952 ] Release Mode Workflow [ 22849 ]
Andrew Perepelytsya made changes - 17/Jun/07 01:06 PM
Workflow Release Mode Workflow [ 22849 ] Main Mule Workflow [ 25507 ]
Andrew Perepelytsya made changes - 17/Jun/07 01:25 PM
Workflow Main Mule Workflow [ 25507 ] Copy of Main Mule Workflow [ 27186 ]
Andrew Perepelytsya made changes - 17/Jun/07 01:32 PM
Workflow Copy of Main Mule Workflow [ 27186 ] Main Mule Workflow [ 29550 ]
Andrew Perepelytsya made changes - 30/Jul/07 08:35 PM
Workflow Main Mule Workflow [ 29550 ] Copy of Main Mule Workflow [ 31012 ]
Andrew Perepelytsya made changes - 30/Jul/07 08:41 PM
Workflow Copy of Main Mule Workflow [ 31012 ] Main Mule Workflow [ 33397 ]
Andrew Perepelytsya made changes - 30/Jul/07 09:03 PM
Workflow Main Mule Workflow [ 33397 ] Copy of Main Mule Workflow [ 34625 ]
Andrew Perepelytsya made changes - 06/May/08 11:09 AM
Workflow Copy of Main Mule Workflow [ 34625 ] Fixed Main Mule Workflow (after JIRA upgrade) [ 61124 ]
Andrew Perepelytsya made changes - 15/May/08 10:17 AM
Workflow Fixed Main Mule Workflow (after JIRA upgrade) [ 61124 ] Copy of Main Mule Workflow [ 64997 ]
Andrew Perepelytsya made changes - 15/May/08 10:53 AM
Workflow Copy of Main Mule Workflow [ 64997 ] Fixed Main Mule Workflow (after JIRA upgrade) [ 68743 ]

People

  • Assignee:
    Alan Cassar
    Reporter:
    Juan Manuel Sanmarco
Vote (0)
Watch (0)

Dates

  • Created:
    12/Apr/06 10:37 AM
    Updated:
    23/Jan/07 04:42 AM
    Resolved:
    22/Nov/06 07:27 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.