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

erahamim (JIRA) jira-events at jboss.com
Fri Jan 12 08:32:00 EST 2007


Statment 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)
    Affects Versions: JBossAS-4.0.5.GA
         Environment: jboss 4.0.5 on windows xp / linux with database oracle 10.0.2
            Reporter: erahamim
            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