This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 326953 - DBWS should support batch sql operations
Summary: DBWS should support batch sql operations
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David McCann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 13:48 EDT by Mike Norman CLA
Modified: 2022-06-09 10:03 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix. (17.23 KB, patch)
2011-06-09 16:16 EDT, David McCann CLA
no flags Details | Diff
Supporting test cases. (9.31 KB, patch)
2011-06-09 16:17 EDT, David McCann CLA
no flags Details | Diff
Updated XSD files. (3.17 KB, patch)
2011-06-13 14:12 EDT, David McCann CLA
no flags Details | Diff
Updated XSD files (new versions) (10.72 KB, patch)
2011-06-23 11:42 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Norman CLA 2010-10-04 13:48:16 EDT
<batch-sql name="get_analyzed_traces">
  <batch-text>
    <text><![CDATA[an INSERT statement]]></text>
    <text><![CDATA[another INSERT statement]]></text>
  </batch-text>
</batch-sql>

The transaction horizon would be the scope of the batch-text lines
and the response would typically only be 0/1 or true/false.
Comment 1 rainer.schild CLA 2010-10-07 08:22:53 EDT
We would like to specify sql transaction handling code in dbwsbuilder file:

Example:
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;

It should be possible to include several parameters into each single SQL statement.

Response should be 0/1 or true/false.
Comment 2 David McCann CLA 2011-06-09 16:16:17 EDT
Created attachment 197731 [details]
Proposed fix.
Comment 3 David McCann CLA 2011-06-09 16:17:11 EDT
Created attachment 197732 [details]
Supporting test cases.
Comment 4 David McCann CLA 2011-06-09 16:31:04 EDT
Reviewed by:  michael.norman@oracle.com
Tests: dbws/testing/batchsql/BatchSQLTestSuite;  all unit tests pass as expected
Revision:  9571
Comment 5 David McCann CLA 2011-06-13 11:19:38 EDT
We expect each SQL statement in the CDATA section to end with '\n'.  For example:
"<dbws-builder xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
  "<properties>" +
    "<property name=\"projectName\">batchSQL</property>" +
     ...
  "</properties>" +
  "<batch-sql " +
    "name=\"avgSalary\" " +
    ">" +
    "<batch-statement><![CDATA[" +
         "START TRANSACTION\n" +
         "SELECT @A:=AVG(SAL) FROM batch1 WHERE JOB='CLERK'\n" +
         "UPDATE batch2 SET AVGSAL=@A WHERE JOB='CLERK'\n" +
         "COMMIT\n" +
         "]]>" +
     "</batch-statement> " +
   "</batch-sql>" +
"</dbws-builder>";

We will return an instance of org.eclipse.persistence.internal.xr.ValueObject with an Integer 'value' property set to 0 (success) or 1 (failure).
Comment 6 David McCann CLA 2011-06-13 14:12:21 EDT
Created attachment 197910 [details]
Updated XSD files.
Comment 7 David McCann CLA 2011-06-23 10:23:18 EDT
Note that I will be checking in new versions of the XSD files:

- eclipselink-dbws_1.1.xsd
- eclipselink-dbws-builder_1.3.xsd
Comment 8 David McCann CLA 2011-06-23 11:42:51 EDT
Created attachment 198478 [details]
Updated XSD files (new versions)
Comment 9 David McCann CLA 2011-06-23 11:53:54 EDT
Reviewed by:  michael.norman@oracle.com
Tests: n/a
Revision: 9612
Comment 10 David McCann CLA 2011-06-23 11:56:36 EDT
Note:  commit comments indicated Bug 340723 by mistake...
Comment 11 Eclipse Webmaster CLA 2022-06-09 10:03:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink