You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Stuart Friedberg (JIRA)" <ib...@incubator.apache.org> on 2005/12/31 03:02:01 UTC

[jira] Created: (IBATIS-240) Add support to generate either non-prepared statements or sequence of simple SQL statements

Add support to generate either non-prepared statements or sequence of simple SQL statements
-------------------------------------------------------------------------------------------

         Key: IBATIS-240
         URL: http://issues.apache.org/jira/browse/IBATIS-240
     Project: iBatis for Java
        Type: New Feature
  Components: SQL Maps  
 Environment: mySQL server, Connector/J driver
    Reporter: Stuart Friedberg


I've discovered the hard way that iBATIS generates prepared statements.

mySQL server does not support multiple SQL statements (semicolon separated) within a prepared statement.  Frequently, it will actually work.  Too often, it will return spurious SQL syntax errors or cause Connector/J to die with array index out of bounds exceptions while decoding messed up result sets.

I finally broke my neat single iBATIS maps with compound SQL statements into multiple iBATIS maps, one for each individual SQL statement.

If iBATIS had an option to do the parameter substitution itself, producing an ordinary (non-prepared) statement, I could use that to work around this server limitation.  It might also come in handy to produce log entries that could be read more directly and easily.

As an alternative, iBATIS could take an option to break down compound SQL statements into a sequence of prepared statements containing only a single SQL statement each, and automatically issue the sequence of statements when the map is "invoked".  That would be a more direct means of addressing the server limitation.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira