[jboss-jira] [JBoss JIRA] Updated: (JBAS-3981) Statement caching in update query which return value

Dimitris Andreadis (JIRA) jira-events at jboss.com
Fri Jan 12 09:05:52 EST 2007


     [ http://jira.jboss.com/jira/browse/JBAS-3981?page=all ]

Dimitris Andreadis updated JBAS-3981:
-------------------------------------

        Summary: Statement caching in update query which return value   (was: Statment caching in update query which return value )
    Component/s: JCA service
       Assignee: Weston Price

> Statement caching in update query which return value 
> -----------------------------------------------------
>
>                 Key: JBAS-3981
>                 URL: http://jira.jboss.com/jira/browse/JBAS-3981
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JCA service
>    Affects Versions: JBossAS-4.0.5.GA
>         Environment: jboss 4.0.5 on windows xp / linux with database oracle 10.0.2
>            Reporter: erahamim
>         Assigned To: Weston Price
>            Priority: Minor
>
> When I set statements cache in oracle-xa-ds.xml:
> <prepared-statement-cache-size>100</prepared-statement-cache-size>
> For the following statement:
> BEGIN 
> UPDATE table SET A=? WHERE ID=? AND TIME=? RETURNING TIME INTO ?; 
> END
> con = DataSourceManager.getConnection();
> statement = con.prepareCall( 'The above query');
> statement.setInt(1,1);
> statement.setTimestamp(2, myTime);
> statement.registerOutParameter(3, Types.TIMESTAMP);
> statement.executeUpdate();
> final Timestamp ts = statement.getTimestamp(lastIndex);
> In this scenario, I'm always getting back the time result even if the update didn't match any row in database.
> When I drop the statement cache I get the result only if there was a row that was updated by this statement.
> I can't use the return value from executeUpdate() since it always return 1.

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

        



More information about the jboss-jira mailing list