[ 
http://issues.apache.org/jira/browse/IBATIS-125?page=comments#action_65996 ]
     
angerclown commented on IBATIS-125:
-----------------------------------

I am having a similar issue with the project I am working on.  In this case, I 
have a stored procedure to do an update that returns true or false if anything 
actually got updated.  It's somewhat painful and a potential bug to remember 
that on updates I have to surround calls to queryForObject with the necessary 
startTransaction, commit, etc.

I am not sure making setCommitRequired public would be the best solution since 
you would still have to remember to call it.  It seems counterintuitive to 
begin with that calling queryForObject actually can run a stored procedure.  I 
think a better solution would be to add a callProcedure method to SqlMapClient 
that returns an Object.  You may need a callProcedureForList method too.

> Add ability to manually mark session dirty
> ------------------------------------------
>
>          Key: IBATIS-125
>          URL: http://issues.apache.org/jira/browse/IBATIS-125
>      Project: iBatis for Java
>         Type: New Feature
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: All
>     Reporter: John Didion

>
> We recently upgraded to 2.0.9b from 2.0.4. The one breaking change was that 
> SqlMapSessionImpl's session field was changed from public to protected. While 
> I understand and support this change, it makes it impossible for us to use 
> stored procedures that do both an update and a select. Using update() means 
> we can't return a result set, and using queryForObject/List means the 
> transaction won't get committed (because setCommitRequired(true) is not 
> called), so the update doesn't work.
> It would be great if you could expose the following method on 
> SqlMapSessionImpl:
> public void setCommitRequired(boolean required) {
>   this.session.setCommitRequired(true);
> }
> I think this is probably preferable to adding a queryAndUpdate method, since 
> that type of operation is rare (and probably not encouraged).

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

Reply via email to