You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Jeff Watkins <je...@bjss.co.uk> on 2006/11/28 17:48:19 UTC

DataObjectImpl Based SDOs and Persistance

Hi,

 

I've created a sample app that uses DAS to persist an SDO passed to my
web-service to a Derby database. If I do as in the BigBank example and
use a manual insert everything is ok, e.g.

 

Command insert = Command.FACTORY.createCommand("insert into MyTable
(name) values ('"

                          + myObject.getName() + "')" );

 

However, when I try to get my DataObjectImpl derived object to apply
itself using "apply.execute((SpecificDOImpl) myObject);", it doesn't
work. Am I doing it wrong or is this feature not in place yet? All I get
is a NPE. There don't appear to be any examples covering this sort of
usage yet.

 

Thanks,
Jeff Watkins


Re: DataObjectImpl Based SDOs and Persistance

Posted by Kevin Williams <ke...@qwest.net>.
I meant to also say that the NPE you received is not very helpful.  
We'll take care of that.
Thanks.
--Kevin


Kevin Williams wrote:

> Hello Jeff,
>
> The applyChanges command is meant to process the change summary 
> associated with a modified graph of SDO's and generate appropriate 
> insert/update/delete statements.  For this to work the graph must 
> originate from the database you are trying to update.  So, for 
> example, a client might request a graph based on some query, then add 
> some DataObject to that graph (and potentially, delete and modify 
> others) and then submit the modified graph back to a DAS connected to 
> the originating database.  The DAS scans the associated change summary 
> and generates and executes statements to reflect all graph changes 
> back to the database.  This scenario may or may not be meaningful to 
> your application.
>
> If you want to perform a write operation today without leveraging the 
> change summary then your alternative is to use the low-level  (manual 
> insert) as you have shown.  That said, we may want to expand the 
> current DAS API's to allow pure inserts and deletes. The change 
> summary may be overkill for scenarios that only require deletes and 
> inserts.   Maybe something like this:
>
>    DAS.delete (List  dataObjects)
>    DAS.insert (List dataObjects)
>
> Would these be helpful?
>
> Also, it looks like you are using a pretty old version.  Maybe M1?  
> The apis have been simplified and many new capabilities exist in the 
> M2 diver.  The trunk has been pretty stable too.
>
> Thanks for your interest.
> -- 
> Kevin
>
>
>
> Jeff Watkins wrote:
>
>> Hi,
>>
>>
>>
>> I've created a sample app that uses DAS to persist an SDO passed to my
>> web-service to a Derby database. If I do as in the BigBank example and
>> use a manual insert everything is ok, e.g.
>>
>>
>>
>> Command insert = Command.FACTORY.createCommand("insert into MyTable
>> (name) values ('"
>>
>>                          + myObject.getName() + "')" );
>>
>>
>>
>> However, when I try to get my DataObjectImpl derived object to apply
>> itself using "apply.execute((SpecificDOImpl) myObject);", it doesn't
>> work. Am I doing it wrong or is this feature not in place yet? All I get
>> is a NPE. There don't appear to be any examples covering this sort of
>> usage yet.
>>
>>
>>
>> Thanks,
>> Jeff Watkins
>>
>>
>>  
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: DataObjectImpl Based SDOs and Persistance

Posted by Kevin Williams <ke...@qwest.net>.
Hello Jeff,

The applyChanges command is meant to process the change summary 
associated with a modified graph of SDO's and generate appropriate 
insert/update/delete statements.  For this to work the graph must 
originate from the database you are trying to update.  So, for example, 
a client might request a graph based on some query, then add some 
DataObject to that graph (and potentially, delete and modify others) and 
then submit the modified graph back to a DAS connected to the 
originating database.  The DAS scans the associated change summary and 
generates and executes statements to reflect all graph changes back to 
the database.  This scenario may or may not be meaningful to your 
application.

If you want to perform a write operation today without leveraging the 
change summary then your alternative is to use the low-level  (manual 
insert) as you have shown.  That said, we may want to expand the current 
DAS API's to allow pure inserts and deletes. The change summary may be 
overkill for scenarios that only require deletes and inserts.   Maybe 
something like this:

    DAS.delete (List  dataObjects)
    DAS.insert (List dataObjects)

Would these be helpful?

Also, it looks like you are using a pretty old version.  Maybe M1?  The 
apis have been simplified and many new capabilities exist in the M2 
diver.  The trunk has been pretty stable too.

Thanks for your interest.
--
Kevin



Jeff Watkins wrote:

>Hi,
>
> 
>
>I've created a sample app that uses DAS to persist an SDO passed to my
>web-service to a Derby database. If I do as in the BigBank example and
>use a manual insert everything is ok, e.g.
>
> 
>
>Command insert = Command.FACTORY.createCommand("insert into MyTable
>(name) values ('"
>
>                          + myObject.getName() + "')" );
>
> 
>
>However, when I try to get my DataObjectImpl derived object to apply
>itself using "apply.execute((SpecificDOImpl) myObject);", it doesn't
>work. Am I doing it wrong or is this feature not in place yet? All I get
>is a NPE. There don't appear to be any examples covering this sort of
>usage yet.
>
> 
>
>Thanks,
>Jeff Watkins
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org