Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
ly104 Absent Member.
Absent Member.
505 views

jdbc driver question


I use the jdbc driver to synchronize data to sql2000 error, suggesting
that the lack of a primary key value, but I directly insert data in the
database can be inserted, then I update this data through the jdbc
driver can be successful,please tell me why? thanks!
log infomation:

DirXML Log Event -------------------
Driver: \IDTREE\services\IdTreeDriverSet2\ID_to_XJLL
Channel: Subscriber
Object: \IDTREE\abc\00000010
Status: Error
Message: <description>Unable to add object. Unable to retrieve
primary key value(s) from event. Event missing required value for
primary key column 'T_IDM_USER.Usercode'.</description
>

<object-dn>O=abc\CN=00000010</object-dn>
<jdbc:document xml:space="preserve"
xmlns:jdbc="urn:dirxml:jdbc"><nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="4.0.0">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<add cached-time="20120207020635.368Z"
class-name="T_IDM_USER"
event-id="services#20120207020635#99#1:a1ea82e5-9139-4eda-848f-e582eaa13991"
qualified-src-dn="O=abc\CN=000
00010" src-dn="\IDTREE\abc\00000010" src-entry-id="256713"
timestamp="0#0">
<add-attr attr-name="Usercode">
<value naming="true"
timestamp="1317262722#22" type="string">00000010</value>
</add-attr>
<add-attr attr-name="Fullname">
<value timestamp="1317262722#6"
type="string">wanghua</value>
</add-attr>
<add-attr attr-name="Password">

<value>E10ADC3949BA59ABBE56E057F20F883E</value>
</add-attr>
<add-attr attr-name="USERSTATE">
<value type="string">1</value>
</add-attr>
</add>


--
ly104
------------------------------------------------------------------------
ly104's Profile: http://forums.novell.com/member.php?userid=110902
View this thread: http://forums.novell.com/showthread.php?t=451909

Labels (1)
0 Likes
5 Replies
Knowledge Partner
Knowledge Partner

Re: jdbc driver question

Remember what the JDBC driver does. It converts XDS to SQL and then SQL
to XDS.

So you send in an <add> XDS document. It needs to generate a SQL
statement that does what you intended.

One of the assumptions is that you will provide a column named
PK_something and that is your primary key column.

Next you have to define how that primary key value is generated when
adding a new object.

since it is often an incrementing numeric, then MAX is one approach.
Add the next highest number. or call a stored procedure to figure it
out. Or use a attribute value.

there is a setting in the Shim configuration that tells the shim how to
do this work. I do not have an example handy to go look at it, but see
if you can find it.


On 2/6/2012 9:26 PM, ly104 wrote:
>
> I use the jdbc driver to synchronize data to sql2000 error, suggesting
> that the lack of a primary key value, but I directly insert data in the
> database can be inserted, then I update this data through the jdbc
> driver can be successful,please tell me why? thanks!
> log infomation:
>
> DirXML Log Event -------------------
> Driver: \IDTREE\services\IdTreeDriverSet2\ID_to_XJLL
> Channel: Subscriber
> Object: \IDTREE\abc\00000010
> Status: Error
> Message:<description>Unable to add object. Unable to retrieve
> primary key value(s) from event. Event missing required value for
> primary key column 'T_IDM_USER.Usercode'.</description
>>

> <object-dn>O=abc\CN=00000010</object-dn>
> <jdbc:document xml:space="preserve"
> xmlns:jdbc="urn:dirxml:jdbc"><nds dtdversion="3.5" ndsversion="8.x">
> <source>
> <product version="4.0.0">DirXML</product>
> <contact>Novell, Inc.</contact>
> </source>
> <input>
> <add cached-time="20120207020635.368Z"
> class-name="T_IDM_USER"
> event-id="services#20120207020635#99#1:a1ea82e5-9139-4eda-848f-e582eaa13991"
> qualified-src-dn="O=abc\CN=000
> 00010" src-dn="\IDTREE\abc\00000010" src-entry-id="256713"
> timestamp="0#0">
> <add-attr attr-name="Usercode">
> <value naming="true"
> timestamp="1317262722#22" type="string">00000010</value>
> </add-attr>
> <add-attr attr-name="Fullname">
> <value timestamp="1317262722#6"
> type="string">wanghua</value>
> </add-attr>
> <add-attr attr-name="Password">
>
> <value>E10ADC3949BA59ABBE56E057F20F883E</value>
> </add-attr>
> <add-attr attr-name="USERSTATE">
> <value type="string">1</value>
> </add-attr>
> </add>
>
>


0 Likes
Meikalainen Valued Contributor.
Valued Contributor.

Re: jdbc driver question

Hi all,

I am currently facing similar challenge on JDBC driver,  of "Unable to add object. Unable to retrieve primary key value(s). Event missing required value for primary key column ".

Any ideas to resolving this issue would be appreciated.

I tried the  suggestions, and various options in the Subscriber Options (subscription-event; subscriber-generated; auto-generated-identity-column) ,  but to no luck.

 

 

Message: <description>Unable to add object. Unable to retrieve primary key value(s) from event. Event missing required value for primary key column 'idm_table.pk_id'.</description>
<object-dn>O=data\OU=users\CN=soso</object-dn>
<jdbc:document xml:space="preserve" xmlns:jdbc="urn:dirxml:jdbc">&lt;nds dtdversion="4.0" ndsversion="8.x">
&lt;source>
&lt;product edition="Advanced" version="4.8.0.0">DirXML&lt;/product>
&lt;contact>NetIQ Corporation&lt;/contact>
&lt;/source>
&lt;input>
&lt;add cached-time="20191205161222.503Z" class-name="idm_table" event-id="labidmvault#20191205161222#1#1:47c5cab0-cbea-4366-b1a3-b0cac547eacb" jdbc:op-id="0" jdbc:op-type="password-set-operation" jdbc:transaction-id="0" qualified-src-dn="O=data\OU=users\CN=so
so" src-dn="\LABIDMVAULT_TREE\data\users\soso" src-entry-id="33896" timestamp="1575562342#1" xmlns:jdbc="urn:dirxml:jdbc">
&lt;add-attr attr-name="identiteetti_id">
&lt;value naming="true" timestamp="1575562291#23" type="string">soso&lt;/value>
&lt;/add-attr>
&lt;add-attr attr-name="NIMIKE">
&lt;value timestamp="1575562342#1" type="string">mr&lt;/value>
&lt;/add-attr>

0 Likes
Michiel Los Contributor.
Contributor.

Re: jdbc driver question

You obviously miss the primary key column, it is hard to tell what column that is from you add event.

It depends on the database table definition, you have to supply a value for that column otherwise your database will tell you this.
0 Likes
Michiel Los Contributor.
Contributor.

Re: jdbc driver question

And is your mapping rule mapping the primary key column at all?

0 Likes
Michiel Los Contributor.
Contributor.

Re: jdbc driver question

From the logging I see the following:

UPDATE view_usr SET username = 'gold1{$pk_idu}', loginame = 'gold1{$pk_idu}' WHERE pk_idu = {$pk_idu}INSERT INTO dbname.idm_table(pk_id, identiteetti_id , kutsumanimi , etunimet)
VALUES ('AA0001,foxtriot' , 'foxtriot1' , '');

Which is weird, it tries to update the view_usr with a $pk_idu key and without a sql statement ending an insert with obvious the values from your add event. So where is the update stemming from and why is there no ";" after the statement if it should be executed at all at that moment.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.