ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Insert/update issues
Date Fri, 24 Mar 2006 17:47:39 GMT
iBATIS does not support multiple result sets.  There are several open JIRA
issues related to stored procedures, and some talk about changing this.  But
it's a big job.

If you can't change the way Sybase works in this cse (i.e. raising an actual
error rather than sending another result set), then you are stuck.

Jeff Butler

On 3/24/06, Christopher.Mathrusse@sybase.com <
Christopher.Mathrusse@sybase.com> wrote:
> I'm working with Sybase ASE 12 using JConnect 6.0 JDBC driver. The problem
> that I am having is when I perform an insert or an update into a table that
> has a trigger, and the trigger calls RaiseError, the error does not get
> converted into an SQLException.  It appears that this information will be
> sent back to the calling application in the form of a resultSet. Seeing as a
> call to execute() could return multiple ResultSets, I'm told the proper way
> to access this information is to retrieve all resultSet returned by the
> PreparedStatement.
> The JDBC API docs do make reference to this:
> The execute method returns a boolean to indicate the form of the first
> result. You must call either the method getResultSet or getUpdateCount to
> retrieve the result; you must call getMoreResults to move to any
> subsequent result(s).
> I'm told the following:
> Some methods only handle a single result and anything but the single
> result will be an exception. When you consider stored procedures in
> particular there is practically anything that can be returned. e.g.
> create proc xx as
>   select * from table    ==> this only throw exception if something like
> the table has been dropped etc.
>   raiserror xxx
>   select 1
>   etc.
> Any method of query that only expects a single result is never going to
> see the raiserror.  Because it does not read the results far enough to get
> to the error.
> result from server =  |1. results set rows | 2.  results message | 3.
> results set rows | end of results |
> So consider results consisting of 3 different result sets if only result
> #1 was read by the method and the program went on then the #2 results
> message would
> not be read unless you used a method like <statement>.execute() and
> process all results.  Trigger output is like this.
> If let's say there were something wrong with the first select and there
> was not a row result but a message, then you would see the SQLException in
> the simple method like <statement>.executeQuery() .
> So what is my work around? How can I configure iBatis so I can receive the
> error raised by the trigger?
> Thanks...
> Chris Mathrusse
> christopher.mathrusse@sybase.com
> Sybase, Inc
> One Sybase Drive
> Dublin, CA 94568
> (925) 236-5553

View raw message