Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Data Deploy fails
Thiags
Hi,
Let me tell you the scenario:
I created a dcr whose xml format is by default name value pair, see attached file.
I have to deploy the value captured here to the table category_ref in the database.It failed with error as
DBD: ERROR:Values for PK column [Category_Id] missing in [data/rec2].
DBD: ERROR:Exception occured: Values for PK column [Category_Id] missing in [data/rec2].
DBD: ERROR:WriteTuple failure to consumer[0]
DBD: ERROR:Unable to process TeamSite source data
DBD: ERROR:deployment [Category] FAILED
I created a sample xml record see attached file in attribute type fashion and ran the deployment it went fine.I was able to insert a record in the existing table.
Currently my dtd file is as seen in the attachment
Any help from you is really appreciated...
Find more posts tagged with
Comments
Migrateduser
Can you please post the associated dbschema.cfg.
It doesn't seem to me that your test was valid. Your xml doc that you tested with conforms to your DTD, but your DCR is in the basic iwov format, rather than being an "xml" type DCR that conforms to the DTD. I don't see a Category_Id item in the DCR, so the message that the PK isn't defined seems correct to me.
TestReport.rptdesign
Thiags
Hi Rob,
The category_id is primary key field in categories_ref table.
please find attached dbschema file.
Thanks,
thiags
Migrateduser
Your dbschema is good for the xml you posted (as you probably figured from the fact that it passes the test), but your DCR isn't generating in that format. You need to either recode your dbschema to match your DCRs, or change your DCR so that it will save in a format that conforms to the category.dtd. I would lean toward the latter.
Thiags
Hi Rob,
How can I change my DCR so that it will save in a format that conforms to the category.dtd.
I have attached my datacapture.cfg file. I would really appreciate if you can throw some light on this.
Thanks for your help.
-Thiags
Migrateduser
At a high level, there are 3 things you need to be aware of.
First, your templating.cfg entry needs to specify that the type is "xml" rather than "iwov", e.g.
[HTML]
[/HTML]
Next, in your DCT, the root element should look something like this:
[HTML]
[/HTML]
Finally, each of the items in your DCT needs to specify the xpath, either absolute or relative to its parent item where the value will be written. One slightly odd thing is that the location is specified using the location attribute for containers, and the pathid attribute for items. See pages 29-31 of the 6.5 forms publisher developers guide for more info.
Hope that helps.
Thiags
Hi Rob,
I followed the steps as mentioned by you. It worked....
Thanks a ton.
Really appreciate your help.
bye,
Thiags
Thiags
Hey Rob,
Another issue chases me..
I tried a deployment with sample record created manually with steps followed based on our discussion, it went fine.
Now I created a new dcr and ran a deployment, it fails.
error says:
DBD: TUPLE={Categories_ref/0/LineItemVendorItemType_Id/0=1, Categories_ref/0/ReportingDisplayName/0=Intranet report, Categories_ref/0=, Categories_ref/0/Name/0=Intranet, IWOV_PROC_FLAG=true, state=Original, path=data/rec3, Categories_ref/0/Category_Code/0=INT}
DBD: ERROR:Exception occured: null
DBD: ERROR:
java.lang.NullPointerException
category_id is autogenerated field and its a primary key as per the table design.
I removed the category_id element in datacapture.cfg and commented the category_id in the schema of ddconfig.xml file.
pls find attached files associated for this case.
Thanks,
Thiags
Dwayne
I could be mistaken, but I don't believe that the primary_key element is optional for the root group. Unfortunately, that makes it difficult to use auto-generated IDs like you're trying to use here.
I've gotten around this in the past by using a TupleFilter, which looks up the appropriate ID (or creates one, if needed) and inserts it into the tuple.
Migrateduser
Another way you can go is to put the path in there and use it as the PK, either the real PK, or just treat it as if it were and ignore the auto-generated sequence.
Thiags
Hi Rob,
I am bit confused on the approach mentioned by you. Can you please explain me with more details.
Really appreciate your help.
Thanks,
Thiags
Dwayne
It's pretty straightforward, really.
Just add a new column to your "Categories_ref" table which will hold the path to the DCR. The value is available from the tuple as "path".
Then add that column as the primary key in the <primary-key> element of your ddconfig.xml file. It doesn't matter that this isn't
actually
the primary key for the file. As long as DataDeploy never has to create the table. it's OK if the group definition is only a subset of the columns in the table.
Does that make any more sense?
Thiags
Hi Dwane,
Thank you very much.
I tried that and it worked. But the other issue is apart from category_id no other column is unique.
We thought of having a separate set of tables created for the teamsite alone which will not have autogenerated primary key column and run data deploy.
In order to synchronise the existing database and the newly created ones (specifically for teamsite) we can write some triggers.Will we have any issues in rollback of content whenever required from teamsite with this model?
Based on your experience with teamsite and DD, do you think this would be the right approach - update directly to the existing database with the autogenerated dropped for primary key column OR Have an intermediate database for data deploy and write triggers to update the target database i.e existing database.
I really appreciate your help.
Migrateduser
Thiags -
PATH should be unique. Are you finding that it isn't?