Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
datadeploy xml-to-db
msa02
How can we handle deletions when deploying from xml-to-db. Suppose I have 10 data-tuples previously deployed from xml and then I delete one data-tuple from my xml and do another deployment, but datadeploy doesn't delete that from the destination table.
dd version 5.2.1 on solaris system.
Find more posts tagged with
Comments
Migrateduser
The xml produced in the proprietary xml-formatted-data format (with data-tuple elements and tuple-field sub-elements) have many restrictions., when it comes to deleting data. DataDeploy performs deletions based on the "state" value that is auto-generated to be one of "Original,Modified,NotPresent". If the state value is NotPresent then the row will be deleted., if you create the xml file in a format other than xml-formatted-data and that it is based on a DTD. My recommendation would be to create a DTD for your data., generate a dbschema for it, and then deploy it so that inserts, updates and deletes could be handled properly. The only other way if you choose to use xml-formatted-data is to delete all existing rows and reinserting new rows. With replicant mapping for a custom DCR based on a DTD properly handled by DD521, you would have no problems in performing the precise operation you want DD to do.
msa02
Thanks for your reply!
Does dd uses the same dtd that is under local/config directory? Also if I create a custom dcr or xml ourside the teamsite, would that be ok. Actually I have written a perl code which parses an excel sheet and creates an xml file which I use for deployng to db. The structure is however same as you have mentioned.
Migrateduser
To generate a dbschema.cfg file for a DTD (either using the DD Admin UI or the iwsyncdb.ipl -dbschemagen command), the DTD should be in a TeamSite workarea. Even if you won't be using Templating to create XML files based on this DTD, you simply have to setup templating.cfg and then copy the DTD into a workarea and run iwsyncdb.ipl -dbschemagen command. Once you create the dbschema.cfg you can setup a DD config file for standalone deployments. XML files that you create using Perl can reside either in the TEamsite filesystem or a regular local (OS) directory. If you want to deploy those XML files residing on a local directory, you can setup the <source> as follows in the DD config file:
<teamsite-templating-records options="wide,full" custom="yes" area="c:/myxmlfiles" area-type="os-filesystem">
<path filelist="c:/temp/myfilelist:/>
</teamsite-templating-records>
Note the following:
1. If you set area-type="os-filesystem", you can specify either a single file to be deployed in <path> or a filelist that contains relative paths of the files, one per each line.
2. If you set area-type="os-filesystem", you must specify the OS filesystem directory name as the value for "area" attribute.
3. If you store your XML files on the IFS (TEamSite mounted filesystem), you can still use the above syntax by specifying the "area" value to point to a directory location on the Y: (if you are using NT or /iwmnt if you are using Solaris).
4. "filelist" file contains relative path (relative to the "area" value specified) of the XML files you want to deploy, one per each line.
msa02
Thanks again for your response! Please allow me to ask you another question: I have tested that if have replicants in the dcr and each replicant represents one row in the table, and if I delete one of the replicants, the corresponding row also gets deleted from the table when I do datadeploy (using dbschema,visit-directory="deep") but If I have more than one dcr's and I delete a dcr from the workarea,should the corrosponding rows which that deleted dcr is holding also get deleted. This is not happening actually. Is there a way I can achieve this at the same time.
Migrateduser
When you delete a DCR from an area in TeamSite and when you deploy it, DD can delete the rows if you are deploying with one of the two following scenarios:
1. a deployment using filelist, with the filelist containing a line for the vpath of the deleted DCR
2. a differential deployment
In the first case, DD would delete rows once it finds that the file doesn't exist in the TeamSite area. In the second case, you specify a base-area and area value. The base-area could be the edition that you published before the deletion of the file and the 'area' could be the edition you published after you deleted the file and submitting the delete.
I suggest you try the option (1). DataDeploy can delete rows that corresponds to a deleted DCR automatically only in DAS mode and not in standalone mode.
msa02
This was very useful for me. Many thanks for your help! Really appreciate!! I've tried the 1st option and it works fine. Only I have to generate the filelist dynamically just before the deployment starts. But that's not a problem.
Thanks again
msa02
Just another question.
How can we invalidate/refresh table cache after datadeploy?
thanks!
Migrateduser
not sure what you mean by table cache?
msa02
The application server, in our case ATG Dynamo, is accessing this table thru cached relational views, which means even after I'm done deploying to database, the changes won't reflect on the site. This is basically a problem which I don't think can be handled within teamsite.
Migrateduser
from your description it seems like ATG Dynamo is doing some sort of caching., not even the database. Once you deploy to a table using DD and query the views on those table using some sort native database client tools, you would see the latest data (which means the database is doing its job correctly). You should check with ATG if there is a way to invalidate the cache maintained inside Dynamo.
iwovGraduate
I believe you will have to invalidate the cache (See chapter SQL repository caching of Repository Guide). The ATG documentation describes how you can do this. If you are using OD-DD integraion, you can use a DNR script to do this, or if you are calling DD from a script, you can have the script invalidate the cache after deployment. Hope that helps.