Update the database using bc4j tag

hi
i am new to struts based bc4j tag.
i have created the one application using the struts based jsp for business component.
this wizard create a web application , with update , delete facility record. and number of pages like :
1) DataEditComponent.jsp
2) DataQueryComponent.jsp
3) DataScrollerComponent.jsp
4) DataTransacationComponet.jsp
5) viewnameBrowse.jsp
6) viewnameEdit.jsp
7) viewnameQuery.jsp
8) description.html
9) content.html
etc...
and number of java files
1) viewnameBrowsAction.java
2) viewnameEditAction.java
3) viewnameForm.java
5) viewnameFormBeaninfo.java
6) viewnameQueryAction.java
and
applicationResource.properties and struts-config.xml.
this application run sucessfully,
but when i clicked on the edit and after change the record and finally update the record internally it update the record in the view object or application module.
but it dont update the data base.
also, the DataTransacationComponent.jsp page display the link like
commit and Rollback
when i click on the commit link it invoked the appropriate java file (Transaction.java) which is provided by the oracle itself.
but it dosent update the record in the database.
last few days i have try to identify , any other requirement which one i was missing
so, please help me

I have a form with form elements like text box,list box with multiple values. I want to insert this using xsql and also update the same. Is there any method by which i can do this by just submitting the form to xsql as posted xml document with out using xsl as transform attribute and posting the xml with ROWSET/ROW form directly which includes my form element values as sub nodes. The easy way of doing is create a view (either simple or object) and write an INSTEAD OF trigger on the view. You can keep insert-request in the xsql and put logic in the trigger whether to update or insert the record.

Similar Messages

  • Updating the database using z bapi without deleting existing data

    hi every body,
    i am using a zbapi in that i am updating a table which is having 40 fields but i am modifying the only four fields but it is deleting the remaining field entries
    i am now attaching the code what i have used
    ZMPETS_SHIPHDR-SHIPDOCNO    = wf_shipdocno.
    ZMPETS_SHIPHDR-VENACCEPTIND = VENACCEPTIND.
    ZMPETS_SHIPHDR-LASTCHANGEDT = SY-DATUM.
    ZMPETS_SHIPHDR-LASTCHANGEBY = SY-UNAME.
    ZMPETS_SHIPHDR-LOEKZ        = ' '.
    CALL FUNCTION 'Z_MPETS_SAVE_SHIPHDR'
      EXPORTING
        zmpets_shiphdr_save       = ZMPETS_SHIPHDR.
    *COMMITING THE UPDATION.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        IMPORTING
          RETURN = RETURN.
    UPDATING THE SHIPMENT ACTIVITY TABLE.
    ZMPETS_SHIPACTIV-PETSDOCNUMBER = wf_shipdocno.
    ZMPETS_SHIPACTIV-LOEKZ    = ' '.
    ZMPETS_SHIPACTIV-ACTIVITY = '20'.
    CALL FUNCTION 'Z_MPETS_SAVE_SHIPACTIV'
      EXPORTING
        zmpets_shipactiv_save       = ZMPETS_SHIPACTIV.
    in the upper function module the code
    is
    modify zmpets_shipactiv from zmpets_shipactiv_save.
    we have to use this compulsory as it is client's standard
    *COMMITING THE UPDATION.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        IMPORTING
          RETURN = RETURN.
    kindly give me reply
    i will reward the points for a best reply

    Welcome to SDN!
    You will need to pass all 40 fields into your BAPI structure (ZMPETS_SHIPACTIV). The problem is that when you use the modify from statement, the BAPI updates the DB as-is from the BAPI structure, and since you are passing it only 4 values, it defaults the others to space.
    Do this:
    SELECT * FROM ZMPETS_SHIPACTIV WHERE <specify key fields here>
    and then
    ZMPETS_SHIPACTIV-PETSDOCNUMBER = wf_shipdocno.
    ZMPETS_SHIPACTIV-LOEKZ = ' '.
    ZMPETS_SHIPACTIV-ACTIVITY = '20'.
    CALL FUNCTION 'Z_MPETS_SAVE_SHIPACTIV'
    EXPORTING
    zmpets_shipactiv_save = ZMPETS_SHIPACTIV.
    This should work.
    Hope this helps.
    Sudha

  • Console Application not updating the database

    Dear all,
    I am new to c# development. I have a console application front end in program.cs
    I have a local database on visual studio.
    When I execute the stored procedure locally on the database the data is getting updated in the database.
    When I update the same through Console Application - the data is not appearing in the database.
    Can somebody throw light on this? Where I am missing
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    namespace AssetApp
    class Program
    static void Main(string[] args)
    bool value = true;
    while (value)
    value = getdisplay();
    //Console.ReadLine();
    //value = false;
    private static bool getdisplay()
    Console.WriteLine("-------------------------------------- ");
    Console.WriteLine("---------------------------------------");
    Console.Clear();
    Console.WriteLine("----------Asset Application------------");
    Console.WriteLine(" 1 Company Asset ");
    Console.WriteLine(" 2 Standby Laptop Register ");
    Console.WriteLine(" 3 Scrap Register ");
    Console.WriteLine(" 4 Purchase Register ");
    Console.WriteLine(" 5 Service Call Report ");
    Console.WriteLine(" 6 IT Helpdesk ");
    Console.WriteLine(" 7 Exit ");
    Console.WriteLine("---------------------------------------");
    string input = Console.ReadLine();
    switch (input)
    case "1":
    CompanyAsset();
    break;
    case "2":
    Console.WriteLine("Standy Laptop Register");
    break;
    case "3":
    Console.WriteLine("Scrap Register");
    break;
    case "4":
    Console.WriteLine("Purchase Register");
    break;
    case "5":
    Console.WriteLine("Service call Report");
    break;
    case "6":
    Console.WriteLine("IT Helpdesk");
    break;
    case "7":
    return false;
    default:
    break;
    return true;
    private static void CompanyAsset()
    Console.WriteLine("------Company Asset------------------------");
    Console.WriteLine("Type the Department Name");
    string departmentName = Console.ReadLine();
    Console.WriteLine("Type the First Name");
    string firstName = Console.ReadLine();
    Console.WriteLine("Type the Last Name");
    string lastName = Console.ReadLine();
    Console.WriteLine("Type the User Name");
    string userName = Console.ReadLine();
    Console.WriteLine("Type the Model Number");
    string modelNumber = Console.ReadLine();
    Console.WriteLine("Type the AssetTypeID");
    string assetTypeID = Console.ReadLine();
    Console.WriteLine("Type the SerialNumber");
    string serialNumber = Console.ReadLine();
    Console.WriteLine("Type the WarrantyStartDate");
    DateTime warrantyStartDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Type the WarrantyEndDate");
    DateTime warrantyEndDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Company");
    string company = Console.ReadLine();
    Console.WriteLine("EngineerID");
    string engineerID = Console.ReadLine();
    Console.WriteLine("ITHelpdeskID");
    string itHelpdeskID = Console.ReadLine();
    Console.WriteLine("EmpID");
    string empID = Console.ReadLine();
    //Handshake
    SqlConnection myNewConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\AssetApp.mdf;Integrated Security=True");
    //open the database
    myNewConnection.Open();
    //create command
    SqlCommand myCommand = myNewConnection.CreateCommand();
    //using the stored procedue to update the database using parameters add
    myCommand.CommandText = "InsertAsset";
    myCommand.CommandType = CommandType.StoredProcedure;
    myCommand.Parameters.Add(new SqlParameter("@DepartmentName", departmentName));
    myCommand.Parameters.Add(new SqlParameter("@FirstName", firstName));
    myCommand.Parameters.Add(new SqlParameter("@LastName", lastName));
    myCommand.Parameters.Add(new SqlParameter("@UserName", userName));
    myCommand.Parameters.Add(new SqlParameter("@ModelNumber", modelNumber));
    myCommand.Parameters.Add(new SqlParameter("@AssetTypeID", int.Parse(assetTypeID)));
    myCommand.Parameters.Add(new SqlParameter("@SerialNumber", serialNumber));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyStartDate", warrantyStartDate));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyEndDate", warrantyEndDate));
    myCommand.Parameters.Add(new SqlParameter("@Company", company));
    myCommand.Parameters.Add(new SqlParameter("@EngineerID", int.Parse(engineerID)));
    myCommand.Parameters.Add(new SqlParameter("@ITHelpdeskID", int.Parse(itHelpdeskID)));
    myCommand.Parameters.Add(new SqlParameter("@EmpID", int.Parse(empID)));
    int recordsAffected = myCommand.ExecuteNonQuery();
    if (recordsAffected == 1)
    Console.WriteLine("Successful your entry");
    else
    Console.WriteLine("Your entry is not successful");
    myNewConnection.Close();
    Console.WriteLine("");
    Console.WriteLine("Press Enter to continue");
    Console.ReadLine();
    public static void StandbyLaptopRegister()
    Console.WriteLine("-------------------------------");
    Console.WriteLine("Select the Date & Time");
    string DateTime = Console.ReadLine();
    Console.WriteLine("");
    ALTER PROCEDURE dbo.InsertAsset
    @DepartmentName NVARCHAR(50),
    @FirstName NVARCHAR(50),
    @LastName NVARCHAR(50),
    @UserName NVARCHAR(50),
    @ModelNumber NVARCHAR(50),
    @AssetTypeID INT,
    @SerialNumber NVARCHAR(50),
    @WarrantyStartDate SMALLDATETIME,
    @WarrantyEndDate SMALLDATETIME,
    @Company NVARCHAR(50),
    @EngineerID INT,
    @ITHelpdeskID INT,
    @EmpID INT
    @parameter1 int = 5,
    @parameter2 datatype OUTPUT
    AS
    /* SET NOCOUNT ON */
    BEGIN
    INSERT CompanyAsset(DepartmentName,
    FirstName,
    LastName,
    UserName,
    ModelNumber,
    AssetTypeID,
    SerialNumber,
    WarrantyStartDate,
    WarrantyEndDate,
    Company,
    EngineerID,
    ITHelpdeskID,
    EmpID)
    VALUES(@DepartmentName,
    @FirstName,
    @LastName,
    @UserName,
    @ModelNumber,
    @AssetTypeID,
    @SerialNumber,
    @WarrantyStartDate,
    @WarrantyEndDate,
    @Company,
    @EngineerID,
    @ITHelpdeskID,
    @EmpID)
    /*RETURN @@IDENTITY*/
    END
    Cheers
    Sathya

    Hello,
    Usually when I see
    AttachDbFilename=|DataDirectory| ...
    The database was added into the project via the IDE add new data source and if so make sure under the property window for the database that "Copy to Output Directory" is set to either the first or last option as the default "Copy always"
    copies the database each time you build the project thus overwrites the last time you ran the project.
    I would recommend the "Copy if Newer" which means the database is only copied if you make changes to the database. Set "Copy if newer", build run check results.
    Of course this may not be the issue but may very well be too.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Using Tabstrip update the database table

    Hi Guy's,
    I created two screens(100 & 110).
    Click 1 pushbutton HRP1000 related information is displayed.
    Click 2 pushbutton it displays HRP1001 relatd information.
    worked to read the data from the Database tables and output displayed sucessfuly .   However i want to entered data in those fields wants to update to database table.
    Please friends help me how to work this senario.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    To update the database records, wrote the logic in PAI
       WHEN 'SAVE'.
        INSERT HRP1001.
    INSERT INTO HRP1001  VALUES wa_P2.
    it displaying an error message " the work area wa_p2 is not long enough.
    and also i tried using it_p2
    it displaying an error message " you can't use internal table as work area".
    Please help me friends  it is very urgent.
    Thanks and Regards,
    Sai.

  • Getting error while deleting rows from the database using the View Object

    Hi All,
    I am using jdev 11.1.1.4.0. I am removing the rows from the database using viewobject( quering the viewobject to find the records i want to delete).
    I am using vo.removeCurrentRow(0). Before this statement I am able to get the rows I want to delete.
    after that i am doing am.transaction.commit(). But I am getting the error..
    javax.faces.el.EvaluationException: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         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:300)
         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:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         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.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1117)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8134)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5863)
         at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6369)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6551)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3275)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3078)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2088)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2369)
         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(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         ... 53 more
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:869)
    Please give suggestions...
    Thanks
    Kanika

    Hi,
    First Run Application module and confirm whether model project is OK,Cause for the Error is Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
    check:
    Issues with table/column name length
    identifier is too long
    I guess following error occurred because above issue
    JBO-26080: DMLException
    Cause: An unexpected exception occurred while executing the SQL to fetch data for an entity instance or lock it.
    Action: Fix the cause for the SQLException in the details of this exception.
    See:
    http://download.oracle.com/docs/cd/A97337_01/ias102_otn/buslog.102/bc4j/jboerrormessages.html#26080Hope you will helpful

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • Updating a database using EJB Inheritance

    I am new to EJB's, so please forgive my ignorance. I creating the following classes that inherit from each other along with a method to update my database:
    @Entity
    @Inheritance(strategy = InheritanceType.JOINED)
    @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
    public abstract class ObjectA implements java.io.Serializable {
         protected String name;
         protected String desc;
         protected String type;
    @Entity
    @DiscriminatorValue("OBJECTB")
    public class ObjectB extends ObjectA implements java.io.Serializable {
         protected String str_b;
         public ObjectB(String name, String desc, String type, String str_b) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
    @Entity
    @DiscriminatorValue("OBJECTC")
    public class ObjectC extends ObjectB implements java.io.Serializable {
         private String str_c;
         public ObjectC(String name, String desc, String type, String str_b, String str_c) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
              this.str_c = str_c;
    public class MyFacade implements ServletContextListener {
         @PersistenceUnit(unitName="Pu")
        private EntityManagerFactory emf;
        @Resource
        private UserTransaction utx;
        public MyFacade() { }
        public void contextDestroyed(ServletContextEvent sce) {
            if (emf.isOpen()) emf.close();
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext context = sce.getServletContext();
            context.setAttribute("MyFacade", this);
         public void updateObject(ObjectA obj) {
            EntityManager em = emf.createEntityManager();
            try{
                utx.begin();
                em.merge(obj);
                utx.commit();
            } catch(Exception exe){
                try {
                    utx.rollback();
                } catch (Exception e) {}
                throw new RuntimeException("Error updating obj", exe);
            } finally {
                em.close();
    }If I do the following:
         String name = "test name";
         String desc = "updating object c";
         String type = "OBJECTC";
         String b = "b";
         String c = "c";
         MyFacade myf = new MyFacade();
         ObjectC objC = new ObjectC(name, desc, type, b, c);
         myf.updateObject(objC);
         .....In my database, only the values associated with ObjectC get updated and nothing from ObjectA or ObjectB get updated in the database. Does the "merge" method not work on inheritance. How do I update my database using inheritance?
    Thanks!
    Message was edited by:
    FourierXForm

    did you only have ISQL for testing it?
    Can you debug the form and look, if someone happens - exceptions, ... ?
    after the update you can use
    message (SQL%ROWCOUNT); pause ;
    to look, how many records were updated

  • Application Compatibility does not update the database.

    Hi,
     I am using application compatibility manager 6.1, and SQL server 2012 as database. ACT run ok and it create the XML file but it does not update the database at "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA" location.
    I can see the valid XML file but somehow the MDF file of database is not updated so my ACT windows does not showing anything on it.
    Any Help would be appreciated.
    Thanks
    Rakesh Patel
    rakesh patel

    Hi Rakesh,
    I am not sure if you have resloved your issue.
    But for helping others to know what to do if they meet the same issue as yours, I consider to mark the post as answered.
    If you would like further assistance, please post back and we will be always here to help you.
    Any concern about this mark behavior, you can just unmark it.
    Thanks for your understanding.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Update the database structure from entity Framework Model

    Hello !
    I'm using VB.net , EF6 with SQL server 2008R2 database.
    This is the situation :
    I have created the application. Using wizard I have created the Entity model from an existing database.
    A client start using this application using this database on his computer.
    After some month , I made some modifications on the database and I have updated the model on my application .
    Now I have a new .exe file that has the new model from the new database.
    I put the new .exe file on the client computer.
    Now on his computer : The .exe file has the new database model , but the sql server database has the old structure.
    I want to know : Is possible to update the database structure from the entity model on application ?
    I want to add a command on application that can make ( if is possible ) this update , so the database become up to date according to entity model ?
    Thank you !

    Hello,
    From your description, it seems that you want to apply a migration for a database first approach, unfortunately, as far as I know, EF Migrations is a product targeted at Code First and doesn't support Database First operations. A workaround I know is to
    use update-scripts. If your database structure would be changed frequently, it is recommended to use the Code First approach which would have a better workaround for migrations, for details, you could refer to this
    video,
     and with the
    Entity Framework Power Tools, it is easy to create a code first based project form an existing database.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Update the database table

    Hi All,
      i need to do  direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table .  So  i am looping  the internal table and what is the best approach to update the database table is it to  use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001  each time in the loop to update each record  and commit work which hits database for each record or use the statement UPDATE  pa0001 from table it_0001 and if count = 1000 then  COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,
    Thanks,
    Latha.

    My Code to update PA0006 is :
    DATA:  t_pa0006 TYPE STANDARD TABLE OF pa0006 INITIAL SIZE 0,
           wa_pa0006 LIKE LINE OF t_pa0006,
           w_lin TYPE i.
    FIELD-SYMBOLS:  <fs_pa0006> LIKE LINE OF t_pa0006.
    SELECT * FROM pa0006 INTO TABLE t_pa0006 WHERE uname = 'PKHAROR'.
    LOOP AT t_pa0006 ASSIGNING <fs_pa0006>.
      <fs_pa0006>-stras = 'My Street'.
    ENDLOOP.
    DESCRIBE TABLE t_pa0006 LINES w_lin.
    UPDATE pa0006 FROM TABLE t_pa0006.
    IF sy-subrc EQ 0.
      COMMIT WORK.
      WRITE:/ w_lin, ' Records have been updated..'.
    ENDIF.
    Reward points for useful answers
    Regards
    Pradeep
    Regards
    Pradeep

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Updating different Databases Using XI

    Hello,
    I am having one requirement for updating different databases using XI.
    The scenario is that
    Data is coming from ERP to XI.
    This data should be inserted or updated in SQL server.
    Depending on certain conditions I need to update different SQL servers.
    Currently I am having one interface which updates one SQL server database.
    I want to change that interface for updating different SQL server databases depending on the data coming from ERP.
    Is it possible?
    How can I achieve this?
    Thanks in Advance
    Abhijit.

    Hi abi,
        For using more than one database server u can use the BPM.
        there in the design phase, while u making the layout of the picture type connection , there in the switch tool , u can put the condition and according to that
    it will connect to the database server.......
    if it is useful give the rewards
    Regards
    Sasi.........

  • Master-Detail table on the JSF is unable to update the database

    Hi all,
    In my ADF application I am using a master-deatail relationship datasource. I have to enter the detail rows for a master table row and submit the detail rows it should update the
    database. For this I created a master-detail table and dragged the same on to my JSF page as ADF Forms. I created the forms as ADF Form included all the buttons and submit button. I
    dragged CreateInsert operation from the detail table datacontrol on to the detail form. When I enter the detail and click on submit the data is not getting submitted in the database.
    Please help me in this.
    Thankd In Advance.

    There is no such thing as an iPhone 's3'.  There is a 3G which can only be updated to iOS 4.2.1 and a 3GS which can be updated to iOS 6.1.3.
    Which model iPhone is this?
    Identifying iPhone models

  • An error occurred while attempting to update the database

    Hi
    the update from 2.82 to 2.9.0 fails for me with following message
    An error occurred while attempting to update the database.
    the update log ends like this
    [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE failed because the
    following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify
    that SET options are correct for use with indexed views and/or indexes on
    computed columns and/or filtered indexes and/or query notifications and/or XML
    data type methods and/or spatial index operations.
    1> 2> 3> [16:56:20] RunShellCommand: Command: osql exited with code: 1
    [16:56:20] RunShellCommand: Exit code indicates failure.
    [16:56:20] UpdateDatabase: Failed to run database update script.
    hope that anyone can solv this for me

    It seems that my problem is with one of ldapservers.
    When the periodic update runs.
    then there will be error periodic update failed
    log file mdm_error looks like this
    [00:01:46] Failed running query:
    IF NOT EXISTS(SELECT LDAPContainerName FROM LDAPContainers WHERE LDAPContainerName=? AND LDAPServerSAKey = ?)
    BEGIN INSERT INTO LDAPContainers(LDAPContainerName, DisplayName, LDAPContainerType, ParentContainerSAKey,
    LDAPServerSAKey, LDAPMemberType, AllowHandsOffEnrollment) VALUES (?,?, 2,
    (SELECT LDAPContainerSAKey FROM LDAPContainers WHERE LDAPContainerName =? AND LDAPServerSAKey =?) , ?, 1, 1) END
    SQLError:
    I think this is the reason that the upgrade fails.
    How can i solve this?

Maybe you are looking for