vbfg1 Absent Member.
Absent Member.
355 views

JDBC Driver and primary keys


Hello everyone,

First let me thank you for this excellent community. I have searched
through it many times over the last couple of years and more than once
the wisdom I've found here has got me out of a hole.

I've spent the day experimenting with the JDBC driver. This is normally
foreign territory to me so I was a little apprehensive about this -
lots' of scope for things I don't understand to go wrong, with lots of
added potential for me to not understand what it is I don't understand.
I have made some good progress though, and through finding other people
with the same error messages have managed to get myself in a position
where I can I can modify the view on the database, rename the columns
and add extra ones, and then re-read the schema and note that the extra
columns are present. Basic connectivity is clearly working - in itself
more progress than I expected to make today.

I have come unstuck a little here though and I'm not sure how to
proceed.

What I want to do is use the Subscriber channel to populate a table in
our servicedesk / job-tracking application. This is simple user
information and there is almost a direct mapping between the fields
available in eDirectory and in this one database table. Our users are
all in there already on the live system via perl scripts I've used to do
this in the past.

The primary key is postno which in the schema map I have mapped to
workforceID. However, when I attempt to synchronise a user across the
error I get is:


-9005 The Driver returned a "fatal" status indicating the
driver should shut down. Detail from driver: <description>Unable to
initialize subscriber. An error was encountered while parsing parameter
'key-gen'. Unable to generate primary key value. String fields must have
a minimum length of 19 characters.


So I'm guessing here that the driver is expecting some kind of response
indicating that a primary key has been generated (presumably for
association purposes), while I am attempting to set the primary key with
data that is already known and guaranteed unique.

Is anybody able to offer some guidance on how to achieve this? This is
just an experiment so I'm quite prepared to throw everything I have
away.


--
vbfg
------------------------------------------------------------------------
vbfg's Profile: http://forums.novell.com/member.php?userid=29840
View this thread: http://forums.novell.com/showthread.php?t=451591

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

Re: JDBC Driver and primary keys

> The primary key is postno which in the schema map I have mapped to
> workforceID. However, when I attempt to synchronise a user across the
> error I get is:


Presumably you realized you need to rename it to PK_postno, has to have
that leading PK_ (Not sure if it is case sensitive or not).


> -9005 The Driver returned a "fatal" status indicating the
> driver should shut down. Detail from driver:<description>Unable to
> initialize subscriber. An error was encountered while parsing parameter
> 'key-gen'. Unable to generate primary key value. String fields must have
> a minimum length of 19 characters.
>
>
> So I'm guessing here that the driver is expecting some kind of response
> indicating that a primary key has been generated (presumably for
> association purposes), while I am attempting to set the primary key with
> data that is already known and guaranteed unique.


There is a configuration setting for key-gen. Basically, when the time
comes to add a new entry to the table, how do you calc the new PK_
value? Usually this is a numeric, or a GUID, or something else. In
your case, sounds like it is a number you are providing.

I forget all the settings, but one of them should let you send through
your value (trusting that you ensured its uniqueness first. All bets
are off if you screw that up).



> Is anybody able to offer some guidance on how to achieve this? This is
> just an experiment so I'm quite prepared to throw everything I have
> away.
>
>


0 Likes
vbfg1 Absent Member.
Absent Member.

Re: JDBC Driver and primary keys


Yeah, it's definitely unique. There's an in-house proto-IDM app that
allocates unique usernames and numerical IDs as students come through
the registration process.

Setting the primary key method and timing parameter to
"tablename(none)" seems to have fixed my problem.

I've also unlinked the UserDDL policy from the Sub Command Transform.
From what I can figure out about it that seems to assume I'm creating
real genuine users here instead of just rows that are references to them
(authentication for those users happens against LDAP, they're just in
the database for so that jobs can be tied to them and for reporting
purposes).


--
vbfg
------------------------------------------------------------------------
vbfg's Profile: http://forums.novell.com/member.php?userid=29840
View this thread: http://forums.novell.com/showthread.php?t=451591

0 Likes
Knowledge Partner
Knowledge Partner

Re: JDBC Driver and primary keys

On 2/1/2012 7:46 AM, vbfg wrote:
>
> Yeah, it's definitely unique. There's an in-house proto-IDM app that
> allocates unique usernames and numerical IDs as students come through
> the registration process.
>
> Setting the primary key method and timing parameter to
> "tablename(none)" seems to have fixed my problem.


I forget all the options, but one was call a stored procedure to
generate a PK, another was MAX (I.e. find highest and increment) and I
thought there was one where you could provide your own value...



> I've also unlinked the UserDDL policy from the Sub Command Transform.
> From what I can figure out about it that seems to assume I'm creating
> real genuine users here instead of just rows that are references to them
> (authentication for those users happens against LDAP, they're just in
> the database for so that jobs can be tied to them and for reporting
> purposes).


Ya, that UserDDL is for Oracle 'users'.

This will get better, as eventually they will have Packaged JDBC
drivers, which if you will notice are not yet available in IDM 4.
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.