Status array returned by batch operations contains wrong return value for T2

Bug #1349644 reported by Aruna Sadashiva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
New
Medium
RuoYu Zuo

Bug Description

The status array returned from T2 contains a different value compared to T4. T4 returns -2 and T2 returns 1.

The oracle JDBC documentation states:

0 or greater — the command was processed successfully and the value is an update count indicating the number of rows in the database that were affected by the command’s execution Chapter 14 Batch Updates 121

Statement.SUCCESS_NO_INFO — the command was processed successfully, but the number of rows affected is unknown

Statement.SUCCESS_NO_INFO is defined as being -2, so your result says everything worked fine, but you won't get information on the number of updated columns.

For a prepared statement batch, it is not possible to know the number of rows affected in the database by each individual statement in the batch. Therefore, all array elements have a value of -2. According to the JDBC 2.0 specification, a value of -2 indicates that the operation was successful but the number of rows affected is unknown.

Changed in trafodion:
assignee: nobody → Kevin Xu (kai-hua-xu)
Changed in trafodion:
milestone: none → r0.9
Changed in trafodion:
milestone: r0.9 → r1.0
Revision history for this message
Aruna Sadashiva (aruna-sadashiva) wrote :

Also, when the batch has update statements, there is only one element in the array . For T2, it is the total number of records affected, for T4, its -2 (but only one element in array).

Revision history for this message
Kevin Xu (kai-hua-xu) wrote :

For T2, it returns an array which is the same as batch size and the number of effected rows in each element.
For T4, it doesn't get the number of effected rows. Arvind will take a look server-side code.

Revision history for this message
Jian Jin (jian-jin) wrote :

Need further investigation on mxosrvr code. Agreed by Rao, we can change it to lower priotity bug, which is not targeted for 1.0 release.

Changed in trafodion:
assignee: Kevin Xu (kai-hua-xu) → Arvind Narain (arvind-narain)
importance: High → Medium
milestone: r1.0 → r1.1
Changed in trafodion:
assignee: Arvind Narain (arvind-narain) → Daniel Lu (ping-lu)
milestone: r1.1 → r1.2
Changed in trafodion:
assignee: Daniel Lu (ping-lu) → Kevin Xu (kai-hua-xu)
Changed in trafodion:
assignee: Kevin Xu (kai-hua-xu) → xiu-zhu.zhang (xiu-zhu-zhang)
assignee: xiu-zhu.zhang (xiu-zhu-zhang) → RuoYu Zuo (ruo-yu-zuo)
Revision history for this message
Chen-Yun Fan (chen-yun-fan) wrote :

I re-assgined to Ruoyu since this bug will be fixed together after Ruoyu's T2 rowset support fixing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.