| Summary: | DBWS should support batch sql operations | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Mike Norman <michael.norman> | ||||||||||
| Component: | Eclipselink | Assignee: | David McCann <david.mccann> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | david.mccann, eclipselink.dbws-inbox, rainer.schild | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
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. Created attachment 197731 [details]
Proposed fix.
Created attachment 197732 [details]
Supporting test cases.
Reviewed by: michael.norman@oracle.com Tests: dbws/testing/batchsql/BatchSQLTestSuite; all unit tests pass as expected Revision: 9571 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). Created attachment 197910 [details]
Updated XSD files.
Note that I will be checking in new versions of the XSD files: - eclipselink-dbws_1.1.xsd - eclipselink-dbws-builder_1.3.xsd Created attachment 198478 [details]
Updated XSD files (new versions)
Reviewed by: michael.norman@oracle.com Tests: n/a Revision: 9612 Note: commit comments indicated Bug 340723 by mistake... The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
<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.