New record insert in JHeadstart application deployed to Tomcat

Hello Friends,
I developed an application with JHeadstart and it works well but when I deploy it into Tomcat a problem appears:
I have some records -let's say employees- and I want to enter a new record. I click the "New Employee" button but the selected record seems in the form instead of empty form. This problem is seen in the first run of the program.
How can I overcome this Tomcat problem, I need an immediate help.
thanks...

Dear Muller,
THanks your reply, As my test to generate new jheadstrat application again that using JHEADSTART10.1.2.2.32 release, the problem be solve! but I follow /install.html to migration our exist application that using JHEADSTART10.1.2., the problem cannot be solve after did all migration procedure , the problem whether can be solve using migration path on exist application?
the following is my migration procedure:
For upgrading from a previous JHeadstart 10.1.2.0.x build, apply the following steps:
1. Apply the steps in section Installation in the existing JHeadstart 10.1.2 Home, overwriting the old JHeadstart 10.1.2.x files.
2. For each JHeadstart project where you want to make it possible to run JHeadstart Application Generator with all the new features and fixes, perform the following steps:
* Select all JHeadstart Generator Templates (*.jut files, *.jjt files, and *.jtp files) in the JDeveloper (ViewController) Project and choose File - Erase from Disk. If you customized one or more templates, you should re-apply the functional changes you made.
* Select all JHeadstart generated files in [HTML Root]\common in the JDeveloper (ViewController) Project and choose File - Erase from Disk. If you customized one or more of these files, you should re-apply the functional changes you made.
* In each Application Structure File, for each Lookup of type "lov", turn on the new Generation Switch "Generate LOV Page?"
3. Other upgrade steps to perform for each JHeadstart project, to ensure that the new JHeadstart Runtime will work correctly:
* Correct the link to the JHeadstart documentation in index.html. In previous builds, this link was incorrect. It should be * Re-enable JHeadstart on each (ViewController) JHeadstart project. Choose Overwrite All and Yes to All, unless you know you have customized images or other supported files other than web.xml or uix-config.xml. A backup will always be made of those two files. If you customized the uix-config.xml or web.xml file, you will have to re-apply the customizations.
* If you don't generate the Struts-Config Service-level Entries anymore (a setting in the JHeadstart Application Structure File), you should manually add the processorClass attribute to the <controller> element of your struts-config.xml file(s) like this: <controller ... processorClass="oracle.jheadstart.controller.strutsadf.JhsRequestProcessor"/>
* If you subclassed any JHeadstart runtime classes in your own Java classes, check the overridden methods to see if they have changed. You might need to change the way you override the JHeadstart behavior as well.
Note that if you have overridden classes in JhsDataAction just to override default behavior of the JHeadstart BindingUtils or ReportingUtils classes, the new JhsDataAction has a much easier way to achieve that. Just override JhsDataAction.getBindingUtils() or JhsDataAction.getReportingUtils(), and make sure that it returns your own subclass of BindingUtils or ReportingUtils.
For upgrading from a previous JHeadstart 10.1.2.x build, apply the following steps:
1. Apply the steps in section Installation in the existing JHeadstart 10.1.2 Home, overwriting the old JHeadstart 10.1.2.x files.
2. Re-enable JHeadstart on each (ViewController) JHeadstart project. Choose Overwrite All and Yes to All, unless you know you have customized images or other supported files other than web.xml or uix-config.xml. A backup will always be made of web.xml and uix-config.xml. If you customized the uix-config.xml or web.xml file, you will have to re-apply the customizations.

Similar Messages

  • Connecting to SQL database via an application deployed in Tomcat

    Hi,
    When the SQL database is restarted, the connection of the web application gets lost and the tomcat has to be restarted manually in order to reset connection with the database. Please let me know if there is a way by which the connection can be re-establised without manually restarting the tomcat.
    Thanks and regards
    Lipi

    Hi Arut,
    Below is the paragraph that is extracted from the
    book:
    “When connecting to a SQL Server database you cannot use Windows authentication or the SharePoint Server single sign-on service, named Secure Store Service(SSS). You are limited to using a SQL Server authentication user name and password, which are sent
    over the network in plain text.”
    So Windows authentication users are not supported to connect to SQL Server databases in SharePoint Designer.
    As the error still occurs when you connect to SQL server with SQL server authentication users, I recommend to check if the SQL Server authentication method is set to be SQL Server and Windows Authentication mode and please make sure that the account has
    permission to access SQL Server databases.
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Duplicating a Record with a Webserver Application

    Hello,
    We have a Designer generated webserver application. The users want me to add a button that will duplicate the existing record, except for a few fields. They then want to change a few fields, and save it as a new record.
    I know how to add the button using User/Help Text, but I do not think I can go to forminsert, actioninsert, actionview, or anywhere else with the data. If anyone has conquered a similar problem, please share the solution with me.
    Thank you,

    Kevin, are you actually trying to insert the record and then show it to them so they can make changes? In that case, you could
    -- build your button, with a hidden value for the current record's primary key
    -- have it call a procedure you build which would
    -- get a primary key for the new record
    -- insert that record
    -- commit
    -- call queryviewbykey with the record identifier
    so they get an update page
    If you don't want to insert the record before they see the page, then it's a little more complicated. Here's how I'd do it.
    -- have your procedure (as above) set a package-level variable to the key of the original record
    -- put an onLoad into your Insert page which calls a Javascript function
    -- dynamically build the Javascript for that function in a packaged utility function called from your bottom of page text. If the package-level variable is not null, you take the values from the record it points to and build Javascript which will set the Form values. You'll need to look at the HTML and Javascript source for the Insert page to get the variable names, etc. If the package-level variable is null, as it will be for the normal "New" button, then you just create a function that doesn't do anything.
    -- then call ActionView with the right action for an insert
    -- jim

  • Count new records from Oracle function.

    Is it possible to count all the new records inserted? I have a script with a couple of insert statements, before I do commit all the actions done in the script I like to read the numbers of new records. I do not have a key that I can use to select those records so I have to make use of a possible Oracle internal option to find out which records are inserted in a certain table after the last commit. Is there such a option?
    With kind regards,
    Johan Louwers.

    David is close, but sql%ROWCOUNT does not work at the sql prompt, not even for INSERT/SELECT.
    SQL> INSERT INTO t VALUES (2, 'TWO');
    1 row created.
    SQL> exec DBMS_OUTPUT.Put_Line('The count is: '||sql%rowcount);
    The count is:
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> CREATE TABLE t1 as SELECT * FROM t WHERE 1=2;
    Table created.
    SQL> INSERT INTO t1
      2  SELECT * FROM t;
    1 row created.
    SQL> exec DBMS_OUTPUT.Put_Line('The count is: '||sql%rowcount);
    The count is:
    PL/SQL procedure successfully completed.
    SQL> rollback;
    Rollback complete.However, if you wrap the thing in a BEGIN/END block, then it works:
    SQL> BEGIN
      2  INSERT INTO t1
      3  SELECT * FROM t;
      4  DBMS_OUTPUT.Put_Line('The count is: '||sql%rowcount);
      5  END;
      6  /
    The count is: 1
    PL/SQL procedure successfully completed.Note that sql%rowcount is not cumulative, it gets reset for every DML operation, so if you have more than one INSERT, and you want to know how many rows were inserted in total, you will need to put the rowcount into a variable and add it up yourself.
    HTH
    John

  • Update New Record

    T1::
    C1
    C2
    C3
    T1
    C1   C2    C3
    A    100   1
    A    108   2
    B    104   1
    B    106   2
    Insert New record
    Insert Into T1(C1,C2,C3)
    Values(A,105,NULL);
    Insert Into T2(C1,C2,C3)
    Values(A,105,NULL);
    Declare
    Begin
    For i in (select T1.C1 from T1,T2 Where T1.C1=T2.C1)
    Loop
    Update T1
    Set C3=(Seelct Rn From
    select ROW_NUMBER() OVER(Partition By C1 oder by C2 ) Rn from T1 where 1=i.C1
    Where C1=i.C1
    And C2=i.C2;
    End loop;
    End;
    Is this update correct to make above sample data to
    T1
    C1   C2    C3
    A    105   1         ---------------------> Inserted New Updated with 1
    A    100   2         ---------------------> Old with C3=1 Now C3=2
    A    108   3
    B    104   1
    B    106   2

    Or for the update part, you could do this:
    update t1 set c3=(case when c3 is not null then c3+1
                            when c3 is null then 1 end)
              where c1 =:c1;You are 'oder by C2' while C2 is not really in the order (105, 100, 108).
    Here is the detail:
    create table t1 (c1 varchar2(1), c2 number(3), c3 number(3));
    insert into t1 values ('A',100, 1);
    insert into t1 values ('A',105, NULL);
    insert into t1 values ('A',108, 2);
    insert into t1 values ('B',104, 1);
    insert into t1 values ('B',106, 2);
    insert into t1 values ('B',110, null);
    CREATE OR REPLACE PROCEDURE TEST AS
      CURSOR c1
      IS
        SELECT DISTINCT C1 FROM T1;
    BEGIN
      FOR item IN c1
      LOOP
        UPDATE t1
        SET c3=(
          CASE
            WHEN c3 IS NOT NULL
            THEN c3+1
            WHEN c3 IS NULL
            THEN 1
          end)
        WHERE c1 =item.C1;
      END LOOP;
    END TEST;
    select * from T1 ORDER BY C1, C3;
    A     105     1
    A     100     2
    A     108     3
    B     110     1
    B     104     2
    B     106     3Edited by: PhoenixBai on Aug 30, 2010 12:47 PM

  • Jbo error on multi records insertion

    using jdev 11.6 .
    error:..Too Many object matchs primary key oracle.job.key[10,1000].
    i have scenario ,have composite parimary key's on table . second parimary key genrating programatically upon when i clik on create opeartion. i m able to save records sccessfully when insert records one by one .
    in vo imple genrating the 2nd primay key and setting value to ---->this.getCurrentRow.SetAttribute("euid",pk2value);
    getting error only when i create a multiple records on table and then click on commit . seems when i commit all records taking latest 2nd pk as 1000 ,
    thanks i any suggestion on this ?
    how to resolve above error

    table have create and commit operation . new records insertion ll happen on popup -window .
    upon click on ok in dialog windows records get added to table and seting the pk value iin vo imple .. this.getCurrentRow.SetAttribute("euid",pk2value);
    how to set and retain value in voimple ?

  • How to insert  new records in Master and detail Forms.

    Hi,
    I am having trouble inserting values in both master and detail view at the same time. The scenarios is I have a Dept Table (View Object-VO1) and Employee Table(View Object -VO2) both linked with a foreign key, as per Default HR schema in Oracle DB XE.
    Now I want to insert new record in both Dept(VO1) and EMP(VO2) table via a New page say ( Page2 ). There is a button on Page1 with button INSERT .I can only drag-drop "CreateInsert" operation on that button for VO1 or VO2. So only text box for Dept records are enable to insert data but not Emp records. Is there a way I can insert data in both the tables at the sametime??
    Thanks,
    MB

    Hi MuradRabbani,
    You can programmatically call both createInsert Operations,
    Add to your pageDef both CreateInsert Operations.
    Create a button tha will call insert method from Master (VO1) and then call insert method for Detail (VO2)
    Here is an Example code of calling the operations:
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer(); //you need ADFUtils.java and JSFUtils.java classes. You can find them in the sample applications in your JDeveloper.
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO1");
    oper.execute();
    -----------------NOTE: at this point you should have set values that compine the ViewLink on the master in order the detail will know where to link the new record there are many ways to do it.
    As an approach try to overrdi the create Method on the in the ViewRowImpl of your Master vo (VO1)
    e.g.
    @Override
    protected void create(AttributeList attributeList) {
    //before
    attributeList.setAttribute("NameOfAttribute", valueHere);
    super.create(attributeList);
    After that you should call the operation for your detail VO2
    e.g.
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    The detail record will now have the values from your master automatically.
    Regards,
    Dimitris.

  • Application Deployed other environment problem updating record

    Hi All,
    I have created a application in my working environment .Now when i want to deployed it to other environment everything goes fine except the updation is not working properly.I have add new and edit option in my application.When after editing any record i apply the changes it shows action processed but neither the modified data reflect changes in the database.But it works fine in my local environment.There is the same internal table structures in both side.Even addition of new record works fine but what may be the cause for not updating the data ?
    I have in great trouble with that.Any solution to this problem?
    Ur early reply will be really appreciable.
    Cheers,
    Eman

    Hi All,
    The problem lies in the page .I Have given it as textfield does not saves state.
    So when it tries to update based on primary key field it shows action processed but internally no update done
    So i solve the problem myself .Hope this tips may help someone.
    Cheers,
    Eman

  • Deploying parts of a JHeadstart application?

    In a small JHeadstart project I wonder how deploy the application. The application has to main windows and 12 wizard windows.
    As the wizard windows (of course) are closely linked to one of the the two main windows there exists one application definition file (listing all wizard and the main windows).
    Currently, the whole application is deployed at the same time. This works fine. What I want is to deploy only parts of the application, lets say only new wizards not previously deployed.
    My question is if it is OK and advicable to deploy parts of the application. If yes, I do not expect to get all the details on how to do it here. Hints for further reading would however be appreciated.

    J2EE only allows for deploying a complete web application. You cannot redeploy (new) parts of a web application.
    So, if you want to deploy the wiuzards separately, then you need to create separate ViewController projects, and deploy them as separate web applications. But then they do not share session state, and users need to log on again for each wizard (unless you are using Single Sign On).
    Steven Davelaar,
    JHeadstart team.

  • ADF: any good examples on inserting a new record

    Hi, I'm currently developing a
    web based application (using jsp + struts on top of ADF)
    and I've seen many many demos and viewlets on
    how to create a page that reads a list of employees
    or master-detail relationship of records.
    However, when I try to make a page which can insert
    a new record (ex. new employee, new department, etc),
    I am baffled, because I couldn't find a good example
    that showed me how to do it.
    Has anyone have a good example?
    thank you.

    Did you check the tutorials page?
    For example:
    http://otn.oracle.com/products/jdev/collateral/tutorials/9050/bizcomp_jsp_tut.html

  • How to insert a new record to table with foreign key

    I have 3 tables like this :
    CREATE TABLE PERSON (
    PK INTEGER NOT NULL,
    NAME VARCHAR(10),
    SSNUM INTEGER,
    MGR INTEGER);
    ALTER TABLE PERSON ADD CONSTRAINT PK_PERSON PRIMARY KEY (PK);
    ALTER TABLE PERSON ADD CONSTRAINT FK_PERSON FOREIGN KEY (MGR) REFERENCES
    PERSON (PK);
    /* Tables
    CREATE TABLE PROJECT (
    PK INTEGER NOT NULL,
    CODE_NAME INTEGER);
    ALTER TABLE PROJECT ADD CONSTRAINT PK_PROJECT PRIMARY KEY (PK);
    /* Tables
    CREATE TABLE XREF (
    PERSON INTEGER NOT NULL,
    PROJECT INTEGER NOT NULL);
    ALTER TABLE XREF ADD CONSTRAINT PK_XREF PRIMARY KEY (PERSON, PROJECT);
    ALTER TABLE XREF ADD CONSTRAINT FK_XREF1 FOREIGN KEY (PERSON) REFERENCES
    PERSON (PK);
    ALTER TABLE XREF ADD CONSTRAINT FK_XREF2 FOREIGN KEY (PROJECT) REFERENCES
    PROJECT (PK);
    I do like the way of "ReverseTutoral" and the file .jdo here :
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="reversetutorial">
    <class name="Person" objectid-class="PersonId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="PERSON"/>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    <field name="person">
    <extension vendor-name="kodo" key="pk-data-column"
    value="MGR"/>
    </field>
    <field name="persons">
    <collection element-type="Person"/>
    <extension vendor-name="kodo" key="inverse"
    value="person"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="person"/>
    </field>
    <field name="pk" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PK"/>
    </field>
    <field name="ssnum">
    <extension vendor-name="kodo" key="data-column"
    value="SSNUM"/>
    </field>
    <field name="xrefs">
    <collection element-type="Xref"/>
    <extension vendor-name="kodo" key="inverse"
    value="person"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="person"/>
    </field>
    </class>
    <class name="Project" objectid-class="ProjectId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    <field name="codeName">
    <extension vendor-name="kodo" key="data-column"
    value="CODE_NAME"/>
    </field>
    <field name="pk" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PK"/>
    </field>
    <field name="xrefs">
    <collection element-type="Xref"/>
    <extension vendor-name="kodo" key="inverse"
    value="project"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="project"/>
    </field>
    </class>
    <class name="Xref" objectid-class="XrefId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="XREF"/>
    <field name="person">
    <extension vendor-name="kodo" key="pk-data-column"
    value="PERSON"/>
    </field>
    <field name="person2" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PERSON"/>
    </field>
    <field name="project">
    <extension vendor-name="kodo" key="pk-data-column"
    value="PROJECT"/>
    </field>
    <field name="project2" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PROJECT"/>
    </field>
    </class>
    </package>
    </jdo>
    Data of those tables are :
    PERSON :
    | PK | NAME | SSNUM | MGR |
    | 1 | ABC | 1 | 1 |
    | 2 | DEF | 5 | 1 |
    PROJECT
    | PK | CODE_NAME |
    | 1 | 12 |
    | 2 | 13 |
    And now I want to add a new record into table XREF : insert into XREF
    values (1,1);
    public void createData() {
    Xref xref = new Xref();
    Person person = new Person(1);
    Project project = new Project(1);
    xref.setPerson(person);
    xref.setProject(project);
    person.getXrefs().add(xref);
    person.getXrefs().add(xref);
    pm.currentTransaction().begin();
    pm.makePersistent(xref);
    pm.currentTransaction().commit();
    I don't know why Kodo automatically insert new record to table PERSON ->
    confilct Primary Key. The errors are :
    0 [main] INFO kodo.Runtime - Starting Kodo JDO version 2.4.1
    (kodojdo-2.4.1-20030126-1556) with capabilities: [Enterprise Edition
    Features, Standard Edition Features, Lite Edition Features, Evaluation
    License, Query Extensions, Datacache Plug-in, Statement Batching, Global
    Transactions, Developer Tools, Custom Database Dictionaries, Enterprise
    Databases, Custom ClassMappings, Custom ResultObjectProviders]
    41 [main] WARN kodo.Runtime - WARNING: Kodo JDO Evaluation expires in 29
    days. Please contact [email protected] for information on extending
    your evaluation period or purchasing a license.
    1627 [main] INFO kodo.MetaData -
    com.solarmetric.kodo.meta.JDOMetaDataParser@e28b9: parsing source:
    file:/D:/AN/Test/classes/reversetutorial/reversetutorial.jdo
    3092 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] open:
    jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
    3325 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ]
    close:
    com.solarmetric.datasource.PoolConnection@164dbd5[[requests=0;size=0;max=70;hits=0;created=0;redundant=0;overflow=0;new=0;leaked=0;unavailable=0]]
    3335 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] close
    connection
    3648 [main] INFO jdbc.JDBC - Using dictionary class
    "com.solarmetric.kodo.impl.jdbc.schema.dict.InterbaseDictionary" to
    connect to "Firebird" (version "__WI-V6.2.972 Firebird 1.0.3)WI-V6.2.972
    Firebird 1.0.3/tcp (annm)/P10") with JDBC driver "firebirdsql jca/jdbc
    resource adapter" (version "0.1")
    4032 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] open:
    jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
    4143 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    preparing statement <3098834>: INSERT INTO XREF(PERSON, PROJECT) VALUES
    4224 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    executing statement <3098834>: [reused=1;params={(int)1,(int)1}]
    4244 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    preparing statement <9090824>: INSERT INTO PERSON(MGR, NAME, PK, SSNUM)
    VALUES (?, ?, ?, ?)
    4315 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    executing statement <9090824>: [reused=1;params={null,null,(int)1,(int)0}]
    4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
    resultSetType or resultSetConcurrency changed
    4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
    resultSetType or resultSetConcurrency changed
    4598 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] begin
    rollback
    4608 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] end
    rollback 10ms
    4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ]
    close:
    com.solarmetric.datasource.PoolConnection@1878144[[requests=2;size=2;max=70;hits=0;created=2;redundant=0;overflow=0;new=2;leaked=0;unavailable=0]]
    4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] close
    connection
    javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
    [PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
    GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
    on table "PERSON" [code=335544665;state=null]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
    [PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
    GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
    on table "PERSON"
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:416)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    NestedThrowablesStackTrace:
    org.firebirdsql.jdbc.FBSQLException: GDS Exception. violation of PRIMARY
    or UNIQUE KEY constraint "PK_PERSON" on table "PERSON"
    at
    org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:425)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    at org.firebirdsql.gds.GDSException: violation of PRIMARY or UNIQUE KEY
    constraint "PK_PERSON" on table "PERSON
    at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1683)
    at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1636)
    at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:865)
    at
    org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:782)
    at
    org.firebirdsql.jdbc.FBConnection.executeStatement(FBConnection.java:1072)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:420)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    Exception in thread "main"

    First off, use the '-primaryKeyOnJoin true' flag when running the reverse
    mapping tool so that you can get rid of that useless Xref class and have
    a direct relation between Person and Project. See the documentation on
    reverse mapping tool options here:
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_reverse.html
    But your real problem is that you are creating new objects, assigning
    primary key values, and expecting them to represent existing objects.
    That's not the way JDO works. If you want to set relations to existing
    objects in JDO, you use the PM to look up those objects. If you try to
    create new objects, JDO will assume you want to insert new records into
    the DB, and you'll get PK conflicts like you see here.
    There are several good books out on JDO; if you're just starting out with
    it, they might save you a lot of time and help you master JDO quickly.

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • Insert New Record in Master Data by Code

    Hi guys,
    I need to insert a new value in an infoobject by code creating:
    1 new record in table P (data not time dependent)
    1 new record in table S (SID table)
    This code could be executed by many tasks in parallel and so it could create problems of concurrency in writing and in quality of the value of new SID selected.
    The first question is:
    THERE IS A STANDARD CODE THAT INSERT A NEW RECORD ALSO CREATING SIDS, managing concurrency in writing and reading?
    The second (if not answer to first)
    This is a part of my code (draft)... any suggestions:
    insert into TABLE P
    INSERT INTO /bic/pzck9idfl VALUES st_p_zck9idfl.
    IF sy-subrc = 0.
    FLAG = 1.
    WHILE FLAG = 0.
        SELECT MAX( sid )
        INTO v_sididfl
        FROM /bic/szck9idfl.
        ADD 1 TO v_sid.
    *record for SID table
        st_zck9idfl-sid = v_sid.
        st_zck9idfl-/bic/zck9idfl = v_idfl.
        st_zck9idfl-chckfl = 'X'.
        st_zck9idfl-datafl = 'X'.
        st_zck9idfl-incfl  = 'X'.
    insert record in SID Table
        INSERT INTO /bic/szck9idfl VALUES st_zck9idfl.
        COMMIT WORK AND WAIT.
    IF Sy-subrc = 0.
    SELECT SINGLE FROM /bic/szck9idfl
    WHERE SID = v_SID
    AND /bic/zck9idfl NE v_idfl.
    IF Sy-SUBRC = 0.
    FLAG = 1.
    ELSE.
    FLAG = 0.
    ENDIF.
    ELSE FLAG = 1.
    ENDIF.
    ENDWHILE.
    Thanks and points to helpful answer!
    ciao
    C@f

    Hi Claudio,
    I would not recommend to do this. Please have a look for standard fm to that job of have a look into the class library to find some methods. On the first look at your code here my comments:
    SELECT MAX( sid )
    INTO v_sididfl
    FROM /bic/szck9idfl.
    ADD 1 TO v_sid.
    Not a pretty good idea, as there is a number range object for getting a sid for each infoobject. If you get your sid like this, all later standard postings will fail with 'duplicate records'.
    *record for SID table
    st_zck9idfl-sid = v_sid.
    st_zck9idfl-/bic/zck9idfl = v_idfl.
    st_zck9idfl-chckfl = 'X'.
    st_zck9idfl-datafl = 'X'.
    st_zck9idfl-incfl = 'X'.
    if you mark all these flags with 'X' you will tell the system that this record is used somewhere in masterdata or in a datatarget and you cannot delete it with standard methods.
    regards
    Siggi

  • Using combination of insert into and select to create a new record in the table

    Hello:
    I'm trying to write a stored procedure that receives a record locator parameter
    and then uses this parameter to locate the record and then copy this record
    into the table with a few columns changed.
    I'll use a sample to clarify my question a bit further
    -- Create New Amendment
    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
    return integer is
    new_mipr_id integer;
    begin
    THIS is causing me grief See comments after this block of code
    insert into mipr
    (select mipr_id from mipr where mipr_number=p_mipr_number),
    (select fsc from mipr where mipr_number=p_mipr_number),
    45,
    (select price from mipr where mipr_number=p_mipr_number),
    practical,
    (select part_number from mipr where mipr_number=p_mipr_number);
    THe above will work if I say the following
    insert into mipr
    (select * from mipr where mipr_number=p_mipr_number);
    BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
    How do I use a combination of more than one select and hard coded values to insert a new record into the table.
    /** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
    select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
    return new_mipr_id;
    end;
    THANK YOU IN ADVANCE!
    KT

    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
    return integer is
    new_mipr_id integer;
    tmp_number number;
    tmp_mipr_id integer;
    begin
    tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
    Question:
    tmp_number :=1; works..
    tmp_number doesn't work with the select statement?
    Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
    variable or what? In my Oracle book, variable means something different.
    Thanks!
    KT
    I have the following code in my stored procedure:
    Good luck,
    Eric Kamradt

Maybe you are looking for

  • Basic Authentication for load testing WSDL Web Service

    I'm trying to load test a web service; the WSDL URL is behind a username and password, using the basic http authentication. I can add the WSDL URL without issue with the username and password, but when I playback the script, I get "401 Unauthorized"

  • XI BPM and SAP R3 Workflow

    Hi. I have a doubt. I have a BPM that has a part that is a loop. Inside the loop i make some checks in R3 vía RFC. I want to know if it's possible to get into this BPM while doing the loop and get the values of a container. I thought about a SAP R3 w

  • My iPad broke and I want to remove it from iTunes - how do I do that?

    I need information on how to remove a non-working iPad from my iTunes profile.

  • SLD Object Server name

    Hi, This is for PI 7.0. I got to http://<hostname>:50000/sld and choose <b>Administrator</b> link. On the right middle/bottom there is a Object Server name. This <b>Object Server</b> name is <b>localhost</b>. Where do I have to change it so I can see

  • Final Cut Server Permissions

    Hi everyone! I'm trying to disable / forbid the following user functions: - Remove from production (action available in shortcut menu - right click on asset in production window) - Lock (button available in Asset windows) - Delete Production button i