How to delete a database record by using EJB entity beans

Hi, All,
Does anyone know how to use entity bean to delete a database record? I have all the EJB entity beans created, including access beans to each. I can successfully create records, find and update records, however, I haven't find a way to delete records yet.
Your response is appreciated.
Cathy

Please see EJB Forums for continue discussion on this subject.
Reference titile: "how to delete database record by using CMP entity beans "

Similar Messages

  • How to delete an operation from order using the bapi

    Can somebody please tell me how to delete an operation from order using the bapi
    BAPI_ALM_ORDER_MAINTAIN.
    Following was the test data for the BAPI.
    000000 OPERATION DELETE 0000040052810070
    000000 SAVE 0000040052810070
    Even I tried entering the operation table. The BAPI control ends fine, but when I check the order using IW32, the operation still exists.
    So, can you please tell me where Iam going wrong.

    Hi Subash Mohanvel,
    Check bapireturn parameter of the bapi BAPI_ALM_ORDER_MAINTAIN after execution of the code , and if there is no error message in the return table then call bapi_Transaction_commit.
    Unless you call this database saving of the records/values will not get reflected in the system.
    Hope that helps.
    Regards
    Kapadia
    ***Assigning points is the way to say thanks in SDN.***

  • How to Delete the condition record in CRM

    HI,
    Can you please help me how to delete the condition record from condition table in CRM.
    Please explain the usage of FM CRMXIF_CONDITION_SEL_DELETE with examples.
    I have also read the documention of the function module. How to use this FM for custom defined condition table.
    (this is the code given in Documentation)
    DATA-OBJECT_REPRESENTATION         = 'E'
    DATA-SEL_OPT-CT_APPLICATION              = 'CRM'
    DATA-SEL_OPT-OBJECT_TASK                    = 'D'
    DATA-SEL_OPT-RANGE-FIELDNAME        = 'PRODUCT_ID'
    DATA-SEL_OPT-RANGE-R_SIGN                  = 'I'    (Including)
    DATA-SEL_OPT-RANGE-R_OPTION           = 'EQ'
    DATA-SEL_OPT-RANGE-R_VALUE_LOW  = 'PROD_1'
    Thanks
    Shankar

    Hi Shankar,
    I am using the same CRMXIF_CONDITION_SEL_DELETE function module to delete condition record present in CRM.
    But it is giving me below error in the return table of the FM after i run the program. Can you please correct me if I am doing any thing wrong?
    Error in  lt_return: SMW3     CND_MAST_SEL_DEL_EXT_VALIDATE     CND_M_SD
    code:
    ls_range-fieldname = 'PRODUCT_ID''.
    ls_range-R_SIGN = 'I'.
    ls_range-R_OPTION = 'EQ'.
    ls_range-R_VALUE_LOW = '123456'.
    APPEND ls_range TO lt_range.
    MOVE lt_range TO ls_entry-SEL_OPT-range.
    ls_data-SEL_OPT-object_task = 'D'.
    ls_data-SEL_OPT-ct_application = 'CRM'.
    ls_data-object_representation = 'E'.
    CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
      EXPORTING
        DATA          = ls_date
    IMPORTING
       RETURN        = lt_return
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      IMPORTING
        return = lt_ret.
    Edited by: Saravanaprasad Nadar on Jul 7, 2010 1:27 AM

  • How to delete a Database view?

    HI Everyone,
    Created a Database in ECC to get the bank details from two tables BNKA and BKPF,
    but now I wanted to delete this View. Can someone tell me how to delete the Database view?
    Thanks
    Vandana

    Goto SE11 > select radio button for view > type view name > press delete icon in top menu (where you have icons for activate, check etc).
    Regards,
    Gaurav

  • How to build dynamic databases(record set) for mobile?

    Hi All ,
    i have an applocation that needs to personalize the data for users .
    i have the data available , but dont know how to personalize it fot users to download special version of my application.
    how to build dynamic databases(record set) for mobile?

    In the load rule in the dimension build settings you would need to go to the tab dimension definition, choose the time dimension and right click on it. Select Edit properties. If you have not done so, set the dimension to be the time dimension. Then go to the generations/levels tab and set the generation names you need. For example if you want YTD, you would set the generation name to Year, if you want QTD set it to Quarter. You would set the number to the generation number that coorisponds to the generation. The DBAG has the list of names for all of the DTS members.

  • How to delete unwanted databases that keep coming back?

    Hi,
    Besides the usual Google mail database I have somehow acquired 2 other databases that I want to get rid off because I don't trust them.
    The first is the one a lot of other people seem to have as well RLDGUID and the other one is from a blog I visited. It's called sql-evercookie.
    I know how to delete the databases but when i do that they just pop back up. I have tried a lot of things, there isn't much you can do, I delete all my cookies, cache and history, rebooted the iPad. Nothing works. There must be a way to get rid of them right?
    I especially upset about the sql one. It's from a friend's blog who hired a company to design her a ' professional' blog. Why that has to include putiing databases on people's devices I don't know but I sure will ask. In the mean time I want it gone.
    Anyone has any ideas?

    So you never received a response to this?  Did you ever get an answer. I just found some on my original...not ipad2.
    Thanks!

  • How to access the database jar file using the derby 10.2.1.6 database ?

    Hi,
    How to access the database jar file using the derby 10.2.1.6 database ?
    I have used like below. And i am getting the following the error:
    "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
    My context.xml file looks like this:
    <Context crossContext="true">
    <Resource name="jdbc/derby" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
    username="xxx" password="xxx" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </Context>
    What could be the reason.?
    Any suggestions will be appriciated.
    Thanks in Advance,
    Gana.

    ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
    Thanks,
    Gana.

  • Record Locking using EJB

    Hi,
    Can anyone please explain me how to achieve Oracle Row level record locking using Enterprise Java Bean ?
    Thanks for the time.
    L G Goundalkar

    It depends upon your container and your container-specific deployment settings. In Weblogic, you can specify database-based pessimistic locking which causes the CMP entity to hold a row-lock on load() until it is comitted or rolled back.

  • SOS problem using one Entity bean for editing records. please help me

    Hello
    I have one great problem using one entity bean 2.1 and i am working with this problem several days and i dont solve it.
    i am using this jb 2.1 for add new records to one oracle database and for editing records.
    I have one great problem for editing records
    I have one objets that is as one of my database table. (PersonaObj.java)
         //personaObj.java
         public class PersonaObj implements Serializable{
              private Integer id_persona; //this ishte database table autonumeric
              private java.lang.String nombre;
              now the set/get methods.
         One field of this objets (bean) is the primary key of the table, and this field is one part of the pk from the entity bean.
         From one session bean i call the entity bena passing the objet
         into the entity bean (interface) i have one methods:
              public getPersona getT56aaat04();
         public void setPersona(PersonaObj obj);
         into the entitybean bean i have:
         public PersonaEntityPK ejbCreate(PersonaObj obj) throws CreateException {
              this.setT56aaat04(obj);
              public abstract Integer getId_persona();
         public abstract void setId_persona(Integer Id_persona);
         public abstract java.lang.String getNombre();
         public abstract void setNombre(java.lang.String Nombre);
         public PersonaObj getPersona() {
              PersonaObj obj = new PersonaObj();
              obj.setId_persona(getId_persona());
              obj.setNombre(getNombre());
              return obj;
         public void setPersona(PersonaObj obj) {
              setId_persona(obj.getId_persona());
              setNombre(obj.getNombre());
    But i have one graet problem.
    adding new record to the database i runs well but if i want to edit one recor appears this error:
    => Error <=
    java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException: EJB Exception: : java.lang.IllegalStateException:[EJB:010144]The setXXX method for a primary key field may only be called during ejbCreate.
    at PersonasEJB_a43o8n__WebLogic_CMP_RDBMS.setId_persona(PersonasEntityEJB_a43o8n__WebLogic_CMP_RDBMS.java:328)
    at PersonasEntityBean.setPersona(PersonasEntityBean.java:114)
    at PersonasEntityEJB_a43o8n_ELOImpl.setPersona(PersonasEntityEJB_a43o8n_ELOImpl.java:45)
    at PersonasSessionBean.editarPersona(PersonasSessionBean.java:849)
    at PersonasSessionBean_bszo9t_EOImpl.editarPersona(PersonasSessionBean_bszo9t_EOImpl.java:208)
    at PersonasSessionBean_bszo9t_EOImpl_WLSkel.invoke(Unknown Source)
    into the session bean i make this (the session recibes one PersonaObj obj):
    T56aContactosEntityLocal personaLocal ;
                   try {
                        personaLocal = personaHome.findByPrimaryKey(new T56aContactosEntityPK(obj.getId_a04()));
                        T56aaat04Obj objTmp = new T56aaat04Obj();
                        objTmp.setAp1_a04(obj.getAp1_a04());
                        objTmp.setEstado_a04("false");
                        personaLocal.setT56aaat04(obj);
    Please can you help me to solve this problem?

    Hello Werner,
    The mappings seem to be alright at a first glance.
    Have you tried out un- and redeploying your application? Sometimes values appear to be cached in the server. So if you have deployed the application before you entered DB_BANK as alias this might solve the problem...
    BR
    Daniel

  • How to start and finish a transaction using EJB 3.0 in JDeveloper

    Hello everybody!
    Does anybody can explain how to start and finish a transaction using EJB 3.0. I need to start a transaction insert some information in some tables and if everything was fine commit the information.
    I put the annotation @TransactionManagement(TransactionManagementType.BEAN) in my session bean and @Resource SessionContext ejbContext; but I don't what anything else I have to do.
    Any help will be appreciate.

    I tryied to use in the client the statement EntityTransaction transaction = myBean.getTransact(); but I receive the EJBException: Cannot use resource level transactions with a container managed EntityManager
    I just need to start a transaction something like this: transaction.begin(); and finish the transaction, something like this: transaction.commit();
    Does anybody can help?

  • Recording Changes to modified Entity Beans

    Hi,
    Our application uses a thick client that communicates with the J2EE middle tier (J2EE 1.4). For performance reasons our client has its own data model. We are using JMS Topics to implement the Observer pattern between the client and the middle tier.
    The two questions I have are:
    1. How can we record changes that occur to Entity beans (CMP) in an automated fashion (ie other than explicitly doing so from the Session bean updating them)?
    2. How can we minimise the number of JMS messages sent when multiple Entity beans are updated per business method. We had thought about hooking into the Transaction lifecycle events, and distributing all objects marked as changed (see Q1) following Transaction comitt.
    I know that we could do both of these manually, however it relies on developers remembering to record changes to objects and also to distribute them when the method completes. I am more interested in possible uses of Container services to alleviate the burden on the application developer.
    thanks in advance.

    Hi,
    One suggestion, I am not sure whether this is what you want to achieve.
    1. I hope by changes to EB you mean inserts, updates and deletes.
    2. I hope you either want to keep these changes in DB or create a log of these chages.
    3. If you want to use container services, then why not to use ejbCreate(), ejbStore(), ejbRemove () methods.
    4.You may create a database table to record changes to your beans. (Bean_Id,Bean_Name,Bean_Field,Bean_Field_Value,TimeStamp).
    5.During a TX you may record changes happening to your bean in an object that has a hashmap containing name of bean field and its latest value.
    6.After successful completion of a TX a JMS Publisher will send this object to a MDB which will create a state change log or update a DB.
    7. You may explore an option of using an entity bean for this as well.
    I am not sure of your exact requirements, bu hop this may help.
    Do revert back.
    VJ

  • Problems accessing tables in oracle database with ejb entity bean

    I have created a simple server application that uses an entity bean (version 2.0) for an existing table in oracle database, and a session bean that is used as an outside interface for performing operations on that table.
    after deploying the server and client application the client attempts to perform an operation with the session bean remote interface it obtained.
    The session bean uses a locale interface to communicate with the entity bean, but when it tries to use its methods (create, findByXXX) it always get the following Exception: java.sql.SQLException: ORA-00942: table or view does not exist.
    the table of course exists, and the username password I'm using has all the permissions needed for this table.
    note - I'm using the Forte enterprise edition 4.0 as developer tool.
    I'll be glad to get some help.
    Here is the full stack trace of the exception:
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
    javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
    java.sql.SQLException: ORA-00942: table or view does not exist
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
    at com.sun.ejb.persistence.SQLEngine.ejb20Finder(SQLEngine.java:226)
    at com.sun.ejb.persistence.PartitionImpl.ejbFinder(PartitionImpl.java:736)
    at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM.ejbFindByEmail(UserInfoEJB_PM.java:393)
    at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM_LocalHomeImpl.findByEmail(UserInfoEJB_PM_LocalHomeImpl.java:64)
    at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:77)
    at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:68)
    at com.cti2.telco.core.ejb.UserManagerEJB_EJBLocalObjectImpl.authenticate(UserManagerEJB_EJB
    LocalObjectImpl.java:63)
    at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB.userLogin(TelcoFacadeEJB.java:80)
    at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB_EJBObjectImpl.userLogin(TelcoFacadeEJB_EJBObjectImpl.java:24)
    at com.cti2.telco.core.ejb.dispatch._TelcoFacadeEJB_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
    at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
    ...

    Well it seems like the problems has a simple explanation. The Forte assigns a default table name (<entityName>EJBTable) when creating an entity bean from an existsing table in DB (which is not the same as the one it was created from !!!). Also, for reason unknown, when you deploy these entity beans, it doesn't even create the new table under its new name (even if instructed to).
    So using the Forte we managed to use successfuly only entity beans that were created "from scretch" (when deployed their tables are created).
    Does anyone know how to change the default name the Forte uses, and make it work properly with entity beans created from an existsing table (without going over the xml's) ?

  • Why Interceptors are not used in Entity beans?

    Why Interceptors are not used in Entity beans?
    Interceptors can be used in MDB, Session bean but not in Entity bean....why so?
    Thanks,
    Rahul.

    Hi,
    why batch updations are not prefered in entity beansPlease refer the specification of ejb and find out what the entity bean is meant for.In short the emtity bean represents the object state which can be persisted.
    Talking regarding the batch updations does not make sense , also the entity bean represents the row of the table mapped to the Object(java Object).
    Regards
    Vicky

  • How to delete the child record from the database

    how to delete a parent and child record from the database can we do it in the servlet and my database is oracle

    I'm not sure I understand the question but you could certainly use the JDBC API from within your servlet to access and modify a DB. You could also use an EJB layer to access your DB and accomplish the same tasks.

  • How to identify database records without using rowid.

    Hello,
    I want to find a way to identify records uniquely in my database without the use of the rowid.
    What I want to do is the following :
    I have a table that contains images. Something like that :
    Table images (id number, image blob).
    Lets say that in this table I have scanned images of persons, invoices and orders.
    I want to be able to associate a record with different records from different tables from my ERP via an association table.
    this table could be :
    Table image_associations (imageid number, rowid_column varchar2(100))
    The "rowid_column" would contain the rowid of the row that is associated with the image.
    The problem is that the rowid is something that changes (for example after export/import).
    So I do not want to use rowid.
    Any ideas?
    Thanks

    What you are saying is you want to avoid theaccepted relational design theory and subvert the
    fundamental principles of very model?
    Yes !!!!Then you are very short sighted and will fail. Why would you want to do this? How is it that you think you are smarter than the forefathers of our industry? an idea so compelling that huge companies have many massive profits implementing the concepts? (sometimes even properly) and how is it that you imagine you can work outside the concepts underlying those tools, within the tool and come to a better solution? this is arrogance surely.
    >
    I think a lot of people use rowid to identify within
    plsql code a record instead of using the table-key.
    There is very limited specific application of the ROWID for temporary reference within known bounds.
    You shouldn't rely on the ROWID. Think about what it actually is: a physical location address hash.
    Don't use it. Just don't.
    As I can remember from my classrooms (a lot of years
    ago) rowid was never mentioned in ER models. Still
    that helps a lot..For very good reason. Rowid is an implementation concept, and not a logical concept.
    Oracle already makes provision at the physical storage level to store BLOBs out of line with a record. You don't need to try to do this at the logical level as I said already.

Maybe you are looking for

  • All of a sudden i can't send email

    all of a sudden i can't send email with my frontier accounts. it fetches incoming email fine but i can't reply or send new email. it just sits in the outgoing box never to be sent. i checked all my out going server- smtp.frontier.com,  port-25, passw

  • How to implement H323 based VCS behind PIX 6.3

    There are some articles talking about issue with H323 traffic passing through firewall.I have a client will deploy Polycom endpoint behind PIX 6.3,my question are 1. Should I do no-NAT or regular Static (inside,outside)? I saw some threads talking H3

  • Help Cant view Attachments......

    When trying to view attachments I get the message that my Service Book info  cannot be found, anyone know anything about this or what I have to do, am I missing software and where can I get it if I do need it???   S 

  • Memory to go website...

    Anybody use the www.memorytogo.com website to purchase memory. I noticed they have several selections for the PowerMac G5. An OEM version and Samsung. Just curious which is better? The prices seem to be pretty good compared to some of the local store

  • Macbook air is so slow

    I got my macbook air in October and its now August and the thing is awful.  Going to a website takes forever and downloading movies takes hours. My internet connection is fine and as a matter if fact old lap tops run smoothly and fast compared to my