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)
Problem in setting an auto generated sequence ID in Data Deploy
Husna
Hi,
I m using Open Deploy 6.2.1 and TeamSite 6.7.2.
I m trying to deploy content metadata to an Oracle 11g Database from the deployment script(OD and DD in the same script i.e.Using dbLoader element).
We need one column in the table which would be an auto-generated sequence ID which would be the Primary key for our table.
Can you let us know how can this be done.
What mapping needs to be done for this column in the schema file being called from the deployment script.
Find more posts tagged with
Comments
vpatel
If you read the DD document you'll figure out that you cannot achieve this with DB generated sequence IDs that are part of the key.
You can create a custom TupleProcessor to generate your sequence IDs. Also if you are deploying DCRs, perhaps you can generate sequential/unique IDs on the DCR side and deploy them.
GroupedData.rptdesign
jagadesh
Use callout in your DD config to get sequence value from DB on DD.
Please find the reference at Chapter 6 External Datasource at page no 152 on 6.2.1 DDadmin guide
jagadesh
Use the below method add the code snippet at given example by Interwoven
method: generateNewValue(Connection conn)
Code snippet:
String query = "select temp_fields_seq.nextval from dual";
String result = "";
try {
PreparedStatement stmt = conn.prepareStatement(query);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
result = rs.getString(1);
}
rs.close();
stmt.close();
} catch (SQLException ex){
System.out.println("Exception:" + ex.getMessage());
result = "";
}
return result;
I hope it will helpful to you
Husna
Thanks for your response.
I m trying to use the callout in the schema file.
I have have the following entry in the required column in my schema file as:
value-from-callout="iwov:dd:java:sample.IWDataDeploySample"
I tried to use the default java files provided by Interwoven i.e. "IWDataDeploySample.java" When I compile this file, it is generating two class files called "IWDataDeploySample.class" and "IWDataDeploySample$TableData.class"
I made a jar of the IWDataDeploySample.class and placed it in the following location: od-home\OpenDeployNG\userlib\
Then restrated the Open deploy services and ran the deployment script.
I m getting the following error.
Unable to load class : sample.IWDataDeploySample.class
I have placed the package sample in the following location:
od-home\OpenDeployNG\conf\tesco\chgprg
Can you please let me know where do I need to place the java/class files for the script to recognise them.
UpAndDownArrow.rptdesign
jagadesh
Hi Husna,
no need to place class files. just place jar file in od-home\OpenDeployNG\userlib\.
You should keep the following points to creating jar
1. Class file should be without any error and warnings
2. You should create jar only for output files not with a project settings and folder
3. Class file generated through JDK1.4 compliance settings
4. Try without package
Please let me know if you face any issues ont this.
DynamicDropDownList.rptdesign
jagadesh
One more point Its work for me on non replicant.I am facing issue on replicant. Confirm whether you need sequence value for replicant or non replicant.
Husna
Hi Jagan,
When I compile the java file I m getting the following:
Note: IWDataDeploySample.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for detail
I have created the jar only for IWDataDeploySample.class
The Class file is generated through JDK 1.5
I have placed the files poutside the package.
I m using the sequence for a non replicant.
I m still facing the same issue.
A null value is getting inserted into that column and the logs are as follows:
DBD: Attempting to load class: IWDataDeploySample
DBD: ERROR:Unable to load class IWDataDeploySample,Class Not Found
jagadesh
Cool. Lets concentrate on class file creation. OD will support jdk1.4 compliance only. Are you using any IDE to generate jar.
If you are using eclipse then select project and click on properties. Window is opened with list of values in left side as tree fromat. There click on Java compiler.Then right side you will see Compiler compliance level dropdown. THere select 1.4.
Even I am using jdk1.5 only but the compiler compliance is 1.4.
refer screenshot for your reference
Husna
Hi Jagan,
I did follow all the steps as suggested by you but I m still facing the same issue...
ERROR : Unable to load the class file.
Husna
Can you please try sending me the jar file that you are using...
So that I can try out whether it works for me...
jagadesh
May be something is wrong in ur jar only. Create sequence in your DB like this temp_fields_seq. After dowloading the attachment remove .txt from file name
Husna
Thanks Jagan,
Will use this jar and let you know if it works for me...
jagadesh
Allways Welcome. Follow the jar procedure creation as specified in the document.
Husna
Sure... Will do this and let you know...
ISCBorisB
Sure... Will do this and let you know...
Another option that often requires very little coding works if you can *distance* a little from DD populated Tables.
You can set DB Triggers on INSERT/UPDATE/DELETE events on *standard* DD Populated Schema. From handlers you can then
use DB Sequence (or whatever you want) to get unique IDs and populate/modify the Schema your Applications use