Sunday, September 23, 2012

ADF BC primary key generation provided by framework

ADF framework provides an option for creating the primary keys. Below are steps to use the same


  1. Create a connection with name ROWIDAM_DB. ( or use  jbo.rowid_am_conn_name property on am or add  -Djbo.rowid_am_conn_name property to project run options  )
  2. Create a table S_ROW_ID in the target schema.
    •   CREATE TABLE "S_ROW_ID" 
    •    ( "START_ID" NUMBER, 
    • "NEXT_ID" NUMBER, 
    • "MAX_ID" NUMBER, 
    • "AUX_START_ID" NUMBER, 
    • "AUX_MAX_ID" NUMBER
    •    );
  3. Insert one row into the table 
    • insert into  "S_ROW_ID" ( "START_ID" , "NEXT_ID" , "MAX_ID" , "AUX_START_ID" , "AUX_MAX_ID" ) values (1,1,9999999999999999999,0,0);
  4. To use the groovy in entity object attribute settings. 
    • oracle.jbo.server.uniqueid.UniqueIdHelper.getNextId()
  5. You can also use a data source for this connection. Config is available on the AM properties.

You can get more information on setting up the primary key generator here. Scroll down to section Set Up Primary Key Generation.

1 comment:

  1. These settings are giving error when deployed on the weblogic server. Any pointers please.

    at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:192)
    ... 159 more
    ## Detail 0 ##
    java.sql.SQLException: ORA-01005: null password given; logon denied

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:466)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:391)
    at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1126)
    at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:507)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:546)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:269)
    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:440)
    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1025)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:682)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:614)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:144)
    at oracle.jbo.server.URLConnectionHelper.getConnectionFromDriver(URLConnectionHelper.java:50)
    at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:192)

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...