You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Philip K. Warren (JIRA)" <ji...@apache.org> on 2006/02/21 22:29:50 UTC

[jira] Created: (TUSCANY-35) Using ApplyChangesCommand on DataObject child (not root) fails silently

Using ApplyChangesCommand on DataObject child (not root) fails silently
-----------------------------------------------------------------------

         Key: TUSCANY-35
         URL: http://issues.apache.org/jira/browse/TUSCANY-35
     Project: Tuscany
        Type: Bug
  Components: Java DAS RDB  
    Reporter: Philip K. Warren
    Priority: Minor


When testing DAS, I initially tried to make a change to a child DataObject of the root returned from a DAS command. Here is some sample code (substitute appropriate DB table/column names):

Connection c = ...;
c.setAutoCommit(false);
cmd = Command.FACTORY.createCommand("SELECT * FROM TABLE WHERE COLUMN=:COLUMN");
cmd.setParameterValue("COLUMN", "val");
cmd.setConnection(c);
DataObject root = cmd.executeQuery();
DataObject childRow = root.getDataObject("TABLE[1]");
managedServerRow.setInt("INTCOLUMN", managedServerRow.getInt("INTCOLUMN")+1);
changeCmd = Command.FACTORY.createApplyChangesCommand();
changeCmd.addPrimaryKey("...");
changeCmd.setConnection(c);
// This fails silently - must operate on root DataObject
changeCmd.execute(childRow);

If you examine the database after executing the ApplyChangesCommand, you will see that the updates were not saved to the DB (and there was no Exception/error from executing the command to know that it failed). ApplyChangesCommand only seems to work from the root DataObject.

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


[jira] Resolved: (TUSCANY-35) Using ApplyChangesCommand on DataObject child (not root) fails silently

Posted by "Kevin Williams (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-35?page=all ]
     
Kevin Williams resolved TUSCANY-35:
-----------------------------------

    Resolution: Fixed

After talking with Steve B. we decided that the DAS should insist that datagraph root is passed to the ApplyChanges command.  An error is now thrown if this is not the case.

> Using ApplyChangesCommand on DataObject child (not root) fails silently
> -----------------------------------------------------------------------
>
>          Key: TUSCANY-35
>          URL: http://issues.apache.org/jira/browse/TUSCANY-35
>      Project: Tuscany
>         Type: Bug
>   Components: Java DAS RDB
>     Reporter: Philip K. Warren
>     Assignee: Kevin Williams
>     Priority: Minor

>
> When testing DAS, I initially tried to make a change to a child DataObject of the root returned from a DAS command. Here is some sample code (substitute appropriate DB table/column names):
> Connection c = ...;
> c.setAutoCommit(false);
> cmd = Command.FACTORY.createCommand("SELECT * FROM TABLE WHERE COLUMN=:COLUMN");
> cmd.setParameterValue("COLUMN", "val");
> cmd.setConnection(c);
> DataObject root = cmd.executeQuery();
> DataObject childRow = root.getDataObject("TABLE[1]");
> managedServerRow.setInt("INTCOLUMN", managedServerRow.getInt("INTCOLUMN")+1);
> changeCmd = Command.FACTORY.createApplyChangesCommand();
> changeCmd.addPrimaryKey("...");
> changeCmd.setConnection(c);
> // This fails silently - must operate on root DataObject
> changeCmd.execute(childRow);
> If you examine the database after executing the ApplyChangesCommand, you will see that the updates were not saved to the DB (and there was no Exception/error from executing the command to know that it failed). ApplyChangesCommand only seems to work from the root DataObject.

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


[jira] Closed: (TUSCANY-35) Using ApplyChangesCommand on DataObject child (not root) fails silently

Posted by "Kevin Williams (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-35?page=all ]
     
Kevin Williams closed TUSCANY-35:
---------------------------------


Verified on revison 379618

> Using ApplyChangesCommand on DataObject child (not root) fails silently
> -----------------------------------------------------------------------
>
>          Key: TUSCANY-35
>          URL: http://issues.apache.org/jira/browse/TUSCANY-35
>      Project: Tuscany
>         Type: Bug
>   Components: Java DAS RDB
>     Reporter: Philip K. Warren
>     Assignee: Kevin Williams
>     Priority: Minor

>
> When testing DAS, I initially tried to make a change to a child DataObject of the root returned from a DAS command. Here is some sample code (substitute appropriate DB table/column names):
> Connection c = ...;
> c.setAutoCommit(false);
> cmd = Command.FACTORY.createCommand("SELECT * FROM TABLE WHERE COLUMN=:COLUMN");
> cmd.setParameterValue("COLUMN", "val");
> cmd.setConnection(c);
> DataObject root = cmd.executeQuery();
> DataObject childRow = root.getDataObject("TABLE[1]");
> managedServerRow.setInt("INTCOLUMN", managedServerRow.getInt("INTCOLUMN")+1);
> changeCmd = Command.FACTORY.createApplyChangesCommand();
> changeCmd.addPrimaryKey("...");
> changeCmd.setConnection(c);
> // This fails silently - must operate on root DataObject
> changeCmd.execute(childRow);
> If you examine the database after executing the ApplyChangesCommand, you will see that the updates were not saved to the DB (and there was no Exception/error from executing the command to know that it failed). ApplyChangesCommand only seems to work from the root DataObject.

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


[jira] Assigned: (TUSCANY-35) Using ApplyChangesCommand on DataObject child (not root) fails silently

Posted by "Kevin Williams (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-35?page=all ]

Kevin Williams reassigned TUSCANY-35:
-------------------------------------

    Assign To: Kevin Williams

Duplicated with failing test case in DefectTests.testTuscany35()

> Using ApplyChangesCommand on DataObject child (not root) fails silently
> -----------------------------------------------------------------------
>
>          Key: TUSCANY-35
>          URL: http://issues.apache.org/jira/browse/TUSCANY-35
>      Project: Tuscany
>         Type: Bug
>   Components: Java DAS RDB
>     Reporter: Philip K. Warren
>     Assignee: Kevin Williams
>     Priority: Minor

>
> When testing DAS, I initially tried to make a change to a child DataObject of the root returned from a DAS command. Here is some sample code (substitute appropriate DB table/column names):
> Connection c = ...;
> c.setAutoCommit(false);
> cmd = Command.FACTORY.createCommand("SELECT * FROM TABLE WHERE COLUMN=:COLUMN");
> cmd.setParameterValue("COLUMN", "val");
> cmd.setConnection(c);
> DataObject root = cmd.executeQuery();
> DataObject childRow = root.getDataObject("TABLE[1]");
> managedServerRow.setInt("INTCOLUMN", managedServerRow.getInt("INTCOLUMN")+1);
> changeCmd = Command.FACTORY.createApplyChangesCommand();
> changeCmd.addPrimaryKey("...");
> changeCmd.setConnection(c);
> // This fails silently - must operate on root DataObject
> changeCmd.execute(childRow);
> If you examine the database after executing the ApplyChangesCommand, you will see that the updates were not saved to the DB (and there was no Exception/error from executing the command to know that it failed). ApplyChangesCommand only seems to work from the root DataObject.

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