CMP with Primary key generation in Oracle

I need to know how can I from my Entity Beans use Oracle sequences to automatically create my primary key.
I know that Weblogic lets to define with sequence to use in the deployment descriptor, but the problem is that I am using Websphere Application Server.
Does anyone have any suggestion doing this.
Very Thanks!!

See if this link helps - http://theserverside.com/patterns/thread.jsp?thread_id=220

Similar Messages

  • ADF BC Primary key generation with SQL Server DB

    Hi,
    I am using ADF 11.1.1.6 to develop a small application that will do some very basic CRUD operations on a SQL Server DB.
    I read through http://www.oracle.com/technetwork/developer-tools/jdev/multidatabaseapp-085183.html before I'm starting to implement the Entity objects.
    This document describes a way to do primary key generation using a table created in the DB and instructs to create an application connection to the Database :
    +2. Create a Connection to the Table+
    In your application, create a database connection named ROWIDAM_DB that points to the database containing your S_ROW_ID table. Alternatively, edit your BC project's properties and add the following Java option to the project's run configuration:
    -Djbo.rowid_am_conn_name= appconnection
    where appconnection is the name of a database connection that points to the S_ROW_ID table.
    My question is how do we do this when we mve to a production environment ?
    Also I'll be interested to hear if anyone has any pointers for developing ADF apps with SQL Server. (gotchas, performance pitfalls etc. )
    -Jeevan
    Upadte : This is SQL Server 2005
    Edited by: Jeevan Joseph on May 2, 2012 9:04 AM

    my apologies to everyone ... This should have been very simple. I just need to provide the config in my AM configuration(bc4j.xml)
    jbo.rowid_am_conn_name* should be set to the connection name you create. For production deployments, theres a similar
    jbo.rowid_am_datasource_name* that should work just fine (though I havent tried if it has any hiccups).
    I'd like to point out one thing though, for whoever might stumble upon this thread and find it useful later on...
    After I did the steps above, everything seemed to work when I tested the app from the AM tester. But when I built a UI for it in ADF Faces, I started getting an exception on Create/CreateInsert :
    java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to oracle.jdbc.OracleConnection
         at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:5533)
         at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5311)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1194)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6826)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:213)The trouble is that the ADF Faces adf-config.xml overrides the AM configuration. Oracle is the default, and it overrides the SQL flavor I set when initializing the Model project.
    This was not mentioned in the original document probably because ADF faces was out of scope for that document.
    I also found this thread extremely useful, and its what reminded me of the ADF Faces AM config overrides : Re: Locking mode 'optupdate' with SQL92
    Cheers !
    Jeevan

  • JBO-25014: Another user has changed the row with primary key oracle.jbo.Key

    Hi,
    I am developing a Fusion Web Application using Jdeveloper 11.1.2.1.0. I have a home.jspx page that has a ADF table built on efttBilling View Object. . When you click on one of the rows in the table, it will take you to detail.jspx where you can edit the row and save. When 'save' is clicked, stored procedures are executed to update/insert rows into few tables , and then go back to home.jspx where you need to see updated content for that row.
    To get down to the exact issue, updates are made to the tables on which the efttBilling View Object is built using a stored procedure. Once this is done, I am trying to requery view object to see new content. But I keep getting JBO-25014: Another user has changed the row with primary key oracle.jbo.Key error. Following are the approaches I followed to query new results:
    a. Executed Application Modules Commit Method. Created 'Commit' Action binding and tied it to homePageDef.xml. Called this binding from a view scope bean.
        BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
         OperationBinding operationBinding = bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
       if (!operationBinding.getErrors().isEmpty())
        return null;
    b. Marked 'Refresh on Insert' , 'Refresh on Update', 'Change Indicator' checkboxes for all the attributes in the entities associated with efttBilling View Object.
    c. Tried to Requery View Object. Created a refreshViewObject method in Application Module Impl.java file, exposed this method to the client interface and created a invokeMethod Action binding in home.jspx
    Code in Application Module:
      public void refresheftTransactionsforBillingAccountViewObj1View()
        System.out.println("In eftTransactionsforBillingAccountViewObj1");
      findViewObject("eftTransactionsforBillingAccountViewObj1").executeQuery();
    Code in view scope bean
            DCBindingContainer bindings =
           (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            OperationBinding operation =
            bindings.getOperationBinding("refresheftTransactionsforBillingAccountViewObj1View");
            operation.execute();
    I have searched web, ADF forums and tried methods suggested in there but no sucess.
    Could anyone please provide some insight in this issue. I have been battling with this since quite some time. I can provide you with the log file too.
    Thanks!
    Shai.

    What code does your Commit method have .. can you try using the Commit executable from the AM itself instead ?
    Also -
    Shai wrote:
    'Change Indicator' checkboxes for all the attributes in the entities associated with efttBilling View Object.
    which all attributes you set this property for . it should just be for History columns as such.
    Did you also check if this could be your scenario ?
    Decompiling ADF Binaries: Yet another reason for "JBO-25014: Another user has changed the row with primary key orac…
    OR
    JBO-25014: Another user has changed the row with primary key oracle.jbo.Key
    OR
    Another user has changed the row with primary key -Table changed externally
    Message was edited by: SudiptoDesmukh

  • Another user has changed the row with primary key oracle.jbo.Key

    Oracle Jdeveloper 11.1.2.1
    ADFbc + JSF
    I have a Page ( Purchase Order Status) (which show all PO to be approved) from this page (page1) the Supervison can call Regular PO (Page2) and change whatever he needs to change. (products, quantities, discounts,warehouse...)
    then on Page2 he invoke (commit) after his changes and return to page1, when supervisor change the status to Approved on page1. I get this Error (Another user has changed the row with primary key oracle.jbo.Key[#]).
    for sure there are no another user changing this PO.
    both page are based on same Entity Object (PO) , how can I solve this Issue? thank you

    hi,
    This occur due to pessimistic locking mode for ApplicationModule ,alter to optimistic and check following sample to get knowledge about locking mode.
    http://andrejusb.blogspot.com/2010/03/optimistic-and-pessimistic-locking-in.html-Suersh

  • Another user has changed the row with primary key oracle.jbo.Key   HELP

    I created VO which based on two entities. Then user search from that VO, when result comes update two row of each entity .
    HERE my function
    public String lockPayment() {
    getAppImpl().getcheckPaymentsVO1().setRangeSize(-1);
    Row[] rw2 = getAppImpl().getcheckPaymentsVO1().getAllRowsInRange();
    checkPaymentsVORowImpl tparow;
    tparow = null;
    for (int j = 0; j < rw2.length; j++) {
    tparow = (checkPaymentsVORowImpl)rw2[j];
    // tparow.setApayLock("1");
    tparow.setAtaxLock("1");
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    When I click it gives me error:
    ----------> Another user has changed the row with primary key oracle.jbo.Key
    Any suggestion !!!!!!
    Edited by: 903927 on Dec 14, 2012 1:00 AM

    Hi,
    see this: https://blogs.oracle.com/onesizedoesntfitall/entry/the_case_of_the_phantom
    Frank

  • Primary key generation

    How do use primary keys generated by database within entity bean?

    DBMS primary key generation uses a set of deployment descriptors that
    are specified at compile time to generate container code which is used
    in conjunction with a supported database to provide key generation
    support. Specify the name of the supported DBMS and the generator name,
    if required by the database. Generated primary key support for Oracle
    databases use Oracle's SEQUENCE. Once the SEQUENCE already exists in the
    database, you specify automatic key generation in the XML deployment
    descriptors. In the weblogic-cmp-rdbms-jar.xml file
    <automatic-key-generation>
    <generator-type>ORACLE</generator-type>
    <generator_name>test_sequence</generator-name>
    <key-cache-size>10</key-cache-size>
    </automatic-key-generator>
    You need to specify the name of the ORACLE SEQUENCE to be used in the
    generator-name element. If the ORACLE SEQUENCE was created with an
    INCREMENT value, then you must specify a key-cache-size. This value must
    match the Oracle SEQUENCE INCREMENT value.
    Owen wrote:
    How do use primary keys generated by database within entity bean?

  • Primary key generation: Using CounterHome?

    I can't find any documentation that talks about automatic primary key generation support on OC4J. I noticed the article on the Orion Support page that mentions their "Counter" bean. Is this the extent of support for automatic primary key generation in OC4J? When I searched for this class in the distribution, I only found it in a demo application in JDeveloper.
    Is this something that is handled directly in the Oracle DB, which is why OC4J doesn't bother to support it?

    Sorry I wasn't specific. By "going nowhere", I meant it went to an error page on the orion site. I don't know why it couldn't find it, because when I just now searched for the article with the title you just gave, the resulting URL was identical to what you gave me originally.
    As to the "counter faq", I think I've seen that before, but I can't get to it right now (server overloaded or something). The one problem I remember with trying to pursue the "counter" solution was somewhat simple. I couldn't find the code. I didn't notice a download for the "Counter" class, and I can't find it in either the jdeveloper or oc4j distributions.
    In any case, I ended up implementing the UUID solution, based on Floyd Marinescu's example in "EJB Design Patterns". I think this will work fine for our application.
    I'd still like to know more about Orion's "Counter" solution, if there's any real code available to see.

  • Cluster DuplicateKeyExecption and primary key generation

    Hi
    I have 2 applications servers working in a cluster.
    I'm using for primary key generation The pattern "sequence blocks" taken from the book ejb design patterns.
    However when i have something like 5 threads that are trying to create new entities then i get DuplikateKeyException on the primary key. (with only 1 jboss server not in a cluster everything is fine).
    I was wondering if anybody could help me pin out the problem, following is my code:
    I estimated it might be an Isolation level problem, however i have updated the isolation level to be serializable in that way in mysql ds and the problem still happend...
    Code:
    <user-name>root</user-name>
    <password></password>
    <TransactionIsolation>TRANSACTION_SERIALIZABLE</TransactionIsolation>
    Sequence entity bean
    Code:
    import javax.ejb.*;
    abstract public class SequenceBean implements EntityBean {
    EntityContext entityContext;
    public java.lang.String ejbCreate(java.lang.String name) throws CreateException {
    setName(name);
    return null;
    public void ejbPostCreate(java.lang.String name) throws CreateException {
    setSIndex(ConfigContainer.getJMXPropertiesFacade().getSequenceSessionBeanStartIndex());
    public void ejbRemove() throws RemoveException {
    public abstract void setName(java.lang.String name);
    public abstract void setSIndex(int sIndex);
    public abstract java.lang.String getName();
    public abstract int getSIndex();
    public void ejbLoad() {
    public void ejbStore() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void unsetEntityContext() {
    this.entityContext = null;
    public void setEntityContext(EntityContext entityContext) {
    this.entityContext = entityContext;
    public int getValueAfterIncrementingBy(int blockSize) {
    this.setSIndex(this.getSIndex()+ blockSize);
    return this.getSIndex();
    sequence session bean
    Code:
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import org.apache.log4j.Category;
    public class SequenceSessionBean implements SessionBean {
    SessionContext sessionContext;
    private Category _log;
    private class Entry {
    Sequence sequence;
    int last;
    private java.util.HashMap _entries = new java.util.HashMap();
    private int _blockSize;
    private int _retryCount;
    private SequenceHome _sequenceHome;
    public void ejbCreate() throws CreateException {
    _log = Category.getInstance(getClass());
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
    Context namingContext = null;
    try {
    namingContext = new javax.naming.InitialContext();
    _blockSize = JMXPropertiesFacade.getInstance().getSequenceSessionBeanBlockSize();
    _retryCount = JMXPropertiesFacade.getInstance().getSequenceSessionBeanRetryCount();
    _sequenceHome = (SequenceHome) namingContext.lookup("SequenceLocalHome");
    catch (NamingException e) {
    _log.error(e.getMessage(), e);
    public void synch() throws InternalException {
    Connection connection = null;
    ResultSet resultSet = null;
    Statement statement = null;
    int maxObjectID = 0, maxUID = 0, maxShareID = 0;
    try {
    connection = MASConnectionManager.getInstance().createConnection();
    String sql = "select max(" + AlbumElementHome.FIELD_NAME_OBJECT_ID + ") maxObjectID from " + AlbumElementHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxObjectID = resultSet.getInt("maxObjectID");
    _log.debug(String.valueOf(maxObjectID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementHome.JNDINAME)).setSIndex(maxObjectID
    + 1);
    sql = "select max(" + UserHome.FIELD_UID + ") maxUID from " + UserHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxUID = resultSet.getInt("maxUID");
    _log.debug(String.valueOf(maxUID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(UserHome.JNDINAME)).setSIndex(maxUID + 1);
    sql = "select max(" + AlbumElementShareHome.FIELD_SHARE_ID + ") maxShareID from " + AlbumElementShareHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxShareID = resultSet.getInt("maxShareID");
    _log.debug(String.valueOf(maxShareID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementShareHome.JNDINAME)).setSIndex(maxShar
    eID + 1);
    } catch (SQLException e1) {
    _log.error(e1.getMessage(), e1);
    } catch (FinderException e) {
    throw new InternalException(e);
    } finally {
         try {
         if (connection != null && !connection.isClosed()) connection.close();
         } catch (SQLException e) {
         _log.error(e.getMessage(), e);
    public int getNextSequenceNumber(String name) {
    try
    Entry entry = (Entry) _entries.get(name);
    if (entry == null)
    // add an entry to the sequence table
    entry = new Entry();
    try
    entry.sequence = _sequenceHome.findByPrimaryKey(name);
    catch (javax.ejb.FinderException e)
    _log.info("can't find sequence: " + name + " trying to create it");
    // if we couldn't find it, then create it...
    entry.sequence = _sequenceHome.create(name);
    _log.info("sequence: " + name + " created");
    _entries.put(name, entry);
    if (entry.last % _blockSize == 0)
    for (int retry = 0; true; retry++)
    try
    entry.last = entry.sequence.getValueAfterIncrementingBy(_blockSize);
    break;
    catch (javax.ejb.TransactionRolledbackLocalException e)
    if (retry < _retryCount)
    // we hit a concurrency exception, so try again...
    _log.info("RETRYING");
    continue;
    else
    // we tried too many times, so fail...
    throw new javax.ejb.EJBException(e);
    return entry.last++;
    catch (javax.ejb.CreateException e)
    throw new javax.ejb.EJBException(e);
    from ejb-jar.xml
    Code:
    <container-transaction>
    <method>
    <description />
    <ejb-name>SequenceSession</ejb-name>
    <method-name>getNextSequenceNumber</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    jboss.xml
    Code:
    <container-configurations>
    <container-configuration>
    <container-name>Standard CMP 2.x EntityBean with cache invalidation</container-name>
              <commit-option>A</commit-option>
              <cache-invalidation>True</cache-invalidation>
    </container-configuration>
    </container-configurations>
    <entity>
    <ejb-name>Sequence</ejb-name>
    <local-jndi-name>SequenceLocalHome</local-jndi-name>
    <!-- no cache for this entity bean -->
    </entity>
    anybody can help with what the problem might be?
    did i update the isolation level correctly?

    _blocksize may be returning 0                                                                                                                                                                                                                                   

  • Help Primary Key generation

    According to article "Generating Primary Key Values in CMP Beans" (http://www.netbeans.org/kb/41/generated-primary-keys.html) you can specifiy automatic primary key generation.
    The following fragment describes a key issue when you have a existing database schema.
    If the database schema is not created during deployment, the primary key column in the mapped table must be of type NUMERIC with a precision of 19 or more, and must not be mapped to any CMP field. The Sun Java System Application Server generates unique values for the primary key column at runtime.
    In the used sample for how to set up a MySql database the creation of the customer table must be as follows:
    CREATE TABLE customer (
    id BIGINT(19) NOT NULL auto_increment, -- this column will be automat. generated
    lastName varchar(25) NOT NULL,
    firstName varchar(30) default NULL,
    PRIMARY KEY (id));
    My question is:
    Is it nescesary to have the field id to be decleared auto incremented?
    The first fragment says that the AS will create new values for the primary key. Or does the generation of primary keys only work if the pk field in the database table is auto incremented by the database?
    Please help. Thanks!
    Johan.

    Hello Johan,
    no, as i remember it does not work if you specify the id column as auto_increment. The J2EE bean container does manage the generation of the primary key, so the database must have a column type int(19) or bigint and primary key, not more.
    Hope this helps, more information is in the J2EE documentation from Sun, page 1012.
    Kind regards,
    marc.

  • Another user has changed the row with primary key -Table changed externally

    Hello,
    I am facing the error: "Another user has changed the row with primary key oracle.jbo.Key[94 ]." during the delete operation.
    User case scenario:
    1. Added new row in the table.
    2. Once new row is added to the the table, another application will update few columns in the newly added row based on some logic.
    3. On the same session I am trying to delete the newly added row and getting above mentioned error.
    I have added a "Button" in the table to partialRefresh the table to check the new values of the changed columns.
    I have checked the forum and found many similar errors and tried the following but nothing helped.
    1. By setting "Auto Refresh = True" for the view object.
    Issue faced-> It worked fine but after few add and remove my db is getting to inconsistent state after which, I am not able to do any add/delete from my page.
    Error: "Too many objects match the primary key oracle.jbo.Key". I have checked this and I am not getting this error when "Auto Refresh = False" even after multiple add and remove actions.
    2. By Setting "Auto Refresh" the iterator associated with the page.
    Issue -> Did not work at all.
    Looking forward inputs from gurus.
    Thanks
    Abhijeet

    Finally I found one solution to this problem at: [ http://www.avromroyfaderman.com/2008/05/bring-back-the-hobgoblin-dealing-with-rowinconsistentexception/|http://www.avromroyfaderman.com/2008/05/bring-back-the-hobgoblin-dealing-with-rowinconsistentexception/]
    Simply overriding the lock() method in the entity object resolved issue. Kudos to the author.
    Code:
    public void lock() {
    try {
    super.lock();
    } catch (RowInconsistentException e) {
    refresh(REFRESH_WITH_DB_ONLY_IF_UNCHANGED | REFRESH_CONTAINEES);
    super.lock();
    But, Now my refresh button is not working as depend on the "Auto Refresh = True" to update the table.
    Can anyone tell me how can I refresh the VO of my table from the button.
    Thanks
    Abhijeet.
    P.S: I have already added the partial trigger but it is work not working as the data is cached in the VO. Removing the Cached property for the VO is creating other problems.

  • Error on commit: Another user has changed the row with primary key : Rec_10

    i am using jdev 11g R2
    i implemented a master form and two detail tables on a jspx page
    added createInsert, commit and rollback buttons
    actions from these buttons all are executed from a bean
    for entity attributes: refresh after insert and update are marked as checked
    i am using login page for authorizing the user by getting the user information from user table
    and then using the userid i am applying the setVisible property on some components at bean code
    when i am inserting a new row there is no problem, here i am generating the new id like 'Rec_10', using a database sequence
    but when i am trying to update a current record, it is showing the error --> Error on commit: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[Rec_22 ]
    on clicking the commit button and also it is not updating the record on database
    Thanx in Advance
    kumar
    Edited by: user10922309 on Nov 18, 2009 3:25 AM
    Edited by: user10922309 on Nov 18, 2009 4:28 AM

    Hi John
    thnq for your quick responce.
    here are the attribute details:
    Attribute Name: RecID, Type: String, Value Type: Expression, Value: 'Rec_' + (new oracle.jbo.server.SequenceImpl("Rec_SEQ_AN", object.getDBTransaction())).getSequenceNumber()
    Updatable: While New and Primary Key, Queryable, Persistent, Mandatory, Refresh After: Update, Refresh After: Update and Insert are markded as checked
    error details:
    oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[APP_22 ].
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1062)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:548)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:7762)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5554)
         at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6057)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6229)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3127)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2935)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1991)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2233)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1580)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1404)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2120)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:693)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:217)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:201)
    --> at Index.saveApplicationAll(Index.java:6246)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1245)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:673)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    --> on click commit button Index.saveApplicationAll method will invoked.
    Thats it.
    Kumar
    Edited by: user10922309 on Nov 18, 2009 4:32 AM

  • Updateable columns with primary key

    Hi,
    I use HTML DB 2.0 and 10g R1.
    With HTML DB i would like create an application with 2 pages.
    The first page is an report from a table with 2 columns, the first column is datatype number(10) with primary key and the second column is varchar2(255).
    The report should looks like with an edit-icon for all rows and both columns with header.
    My problem is, the report has only 2 columns, not 3 columns and the edit-icon is together with the first table column, the header name is Edit.
    What can I do ?
    The second page should be a form linked from the first page for update, insert and delete rows. It's not possible to use a sequence on column with pk for new inserts.
    I don't know, which sample application has the same content or what I have to do.
    Who can help me ?

    Simply create an application "Report and Form" based on your table and modify it as follows:
    - On the report page, modify the query to include the PK column a second time (using an alias)... if this was based on the EMP table with EMPNO being the PK, the query then looks like this (modification bold):
    select
    "EMPNO",
    "EMPNO" as "EMPPLOYEE NUMBER",
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO"
    from "EMP"
    where
    instr(upper("ENAME"),upper(nvl(:P1_REPORT_SEARCH,"ENAME"))) > 0 or
    instr(upper("JOB"),upper(nvl(:P1_REPORT_SEARCH,"JOB"))) > 0
    - In the report attributes, move the added column to the desired position (I moved it directly next to the edit link).
    - On the Form page, just change the item holding your PK column from "hidden" to "Text field".
    You may take a look at http://htmldb.oracle.com/pls/otn/f?p=PK_VISIBLE:1 to verify this is what you're looking for.
    Edit: Oops - I just recognized I cannot update the EMPNO on page 2 since the automated row processing depends on an unchanged PK. However - normally it isn't a good idea to update a PK anyway (since it might be used as FK in some other table(s)).
    It is possible to create new records with manually adding the new PK, so if this is really all you need, then I would suggest you modify your edit page displaying the PK column read-only when editing an existing row and updatable when adding a new record (using 2 items with conditional display, based on the PK being NULL or NOT NULL).
    Holger
    Message was edited by:
    schweich

  • Fast refresh snapshots with primary key deferrable

    Oracle version 8.1.7 standard
    I've created this sample schema:
    Tables:
    create table a_customer
    (c_id integer primary key deferrable,
    zip integer
    create table a_orders
    (o_id integer primary key deferrable,
    c_id integer,
    constraint o_c foreign key (c_id)
    references a_customer(c_id)
    create index c_ind on a_orders(c_id);
    create table a_order_line
    (ol_id integer primary key deferrable,
    o_id integer,
    constraint ol_o foreign key(o_id)
    references a_orders(o_id)
    Snapshot logs:
    create snapshot log on a_customer with primary key (zip);
    create snapshot log on a_orders with primary key (c_id);
    create snapshot log on a_order_line with primary key (o_id);
    When I create the snapshot from another instance:
    create snapshot orders_snap refresh fast as
    select * from a_orders@dblink o where exists
    (select c_id from a_customer@dblink c where
    o.c_id = c.c_id and zip = 19555);
    It return me the error ORA-12015.
    If I recreate the primary keys without "deferrable" option, the snapshot is created succesfully.
    Is it a bug of the Oracle version used?

    Why will someone update the PK of a table. This itself violates the basic design of any application. A PK on a customer ID or a social security no of a person will never get updated in a life time of a user. In case a new number needs to be issued then the correct sequence is to delete the existing record and create new one rather then updating the existing record.
    So you jsut need to check the logic with deleting the PK and then refreshing the Mviews. Please do not update the PK that will itself be a flaw in application design as far my experience is concerend with the PK.
    Amar

  • Automatic primary key generation for pointbase

    Hello friends,
    I was wondering whether it is possible to automatically generate primary keys for a pointbase database. Just like the SQL Server pointbase also has a indentity property. I have used weblogic builder to specify automatic key generation. Through the pointbase console I can see that all the columns for all the tables are marked as nullable except the primary key columns. However when I try to insert data into the database using ejb. I get the exception :
    javax.ejb.EJBException: EJB Exception:: java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    ; nested exception is: java.sql.SQLException: Data exception -- null value not allowed. .
    java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I am not sure whether I understand your question.
    The 'NamedSequenceTable' method is independent of data base type.
    <from-docs>
    Create a table named SEQUENCE to hold the current primary key value. The
    table consists of a single row with a single column, as defined by the
    following statement:
    CREATE table_name (SEQUENCE int)
    INSERT into table_name VALUES (0)
    </from-docs>
    Then, you can add the following in the DD -
    <automatic-key-generation>
    <generator-type>NamedSequenceTable</generator-type>
    <generator_name>table_name</generator-name>
    <key-cache-size>100</key-cache-size>
    </automatic-key-generation>
    The PK type should be set to java.lang.Integer or java.lang.Long
    --Sathish
    <Panduranga Swamy> wrote in message news:[email protected]..
    Hi,
    With named sequecne table,I am able to develop the application. What I
    wanted is Say Table 1 having Identity column as Primary key in the table
    Pointbase database.
    With Automatic primary key generation in Deployment descriptor, We
    generally specify SQL_SERVER or Named Sequencetable for Primary key
    generation.
    For pointbase database, I dont know how to configure this?
    Could you help me in this regard,
    Thanks,
    Pandu

  • Mapping in OWB with primary key and foreign key relationship

    Hi all,
    I am new to this datawarehousing field. I have just started my career. I have to now create a mapping in owb where a table has a field which is a primary key of another table in the same staging area. If you guys could help me out with the a method it can be created that would be very helpful to me.
    I thought of 2 ideas,
    1. If I can use a look up, but then I am not sure if i can use a lookup for primary key, foreign key relationship. If I can use also, I do not know how to use that.
    2. What if I can directly take that the first table and link the primary key of that table to the second table which uses that primary key of the first table as one of its fields.
    I do not know how feasible these methods are. Please guys help me out.
    Thanks in advance.

    I have a similar case where table a and table b having relation but table a got inserted with data and table b is empty so there no values for foriegn key column in table b to realte with table a.
    Now i want to load table b foriegn key with primary key column values of table a.
    how can we do this in owb
    thanks
    kumar

Maybe you are looking for

  • Using 4 monitors on h8-1020

    I have an HD Radeon 6570 video card in this h8-1020 PC. It is only capable of running 3 monitors, I require a 4th. Not for gaming, just for daytrading (running charts). I have tried buying external video cards, however they still limit me to running

  • Why can't I install OSX 10.7 on my 20" imac?

    I want to be able to run iTunes radio on my late 2006 20" iMac but it requires OSX 10.7. I have OSX 10.6.8 and I don't know why I cannot install 10.7 on this model iMac.

  • How can I add new languages on my phone?

    I have an Nokia N80 and i don`t have the French language...How can I add this language on my phone? Solved! Go to Solution.

  • Generating wrong code

    hi, my deployment wizard generates wrong code: all custom finder methods are generated wrong. i checked the xxxPSJDBC.java files and i saw that the wizard generates the sql-statement correct but then: Object __WL_typeObj = __WL_fieldSQLTypes.get("nul

  • Having Muse Browser Issue - Please Help

    Hi, I'm probably not setting up Muse like i'm supposed to so I'm hoping someone can help me. But bottom line is I'm trying to design one of those full screen websites and am having issues.  Chrome has a continuous horizontal scroll bar even when the