Can I get handle to Database Row before an entity is deleted

Hi,
We are using stored procedure to list, insert , update and delete entity objects.To use the stored procedure I override the default queries generated by Toplink and make use of the stored procedure query.The issue here is that my Stored Procedure requires more arguments (like name of the user doing the insert) than there are fields in the entity.I need to provide these argument values to the call.For this I do something like
session.getDescriptor(MyClass.class).getEventManager().addListener(new DescriptorEventAdapter(){
     public void aboutToInsert(DescriptorEvent evt) {
     evt.getRow().put("USER",evt.getSession().getProperty("username"));
I set the username in the unitOfWork out of which I can grab the value in the eventHandler and put it inside the row just before insert.I do the same for modify too.But I dont see a similar methods for "delete".Do we have a aboutToDelete() method where I can get a handle to the row.The preDelete() does not provide a handle to the row.How can I insert additional arg values to the delete query?
Thanks,
Harini

Hello Harini,
Wow, you are correct there is no aboutToDelete, I guess manipulating the row before deletetion is not that common for our TopLink clients as this is the first request I have heard for it. I will add this request to our enhancement database. You might want to follow it up with support if it is a priority for you.
As a workaround you could use the preDelete event to change the stored procedure call with the user name argument (i.e. build the procedure call dynamically in preDelete and set it into the query. The query will have been cloned at this point so there should be no concurrency issues. Make sure when doing this that you do not set the deleteQuery in the descriptor query manager as this will override the original query if set.
Example:
descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
public void preDelete(DescriptorEvent event) {
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("Delete_proc");
call.addNamedArgument("P_ID", "ID");
call.addNamedArgumentValue("USER", "scott");
call.addNamedArgumentValue("TIME", new java.util.Date());
event.getQuery().setCall(call);
});

Similar Messages

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • I did an update on my ipad and now I have to restore it but it says I will lose everything How can I get my pictures on there before I restore my ipad to factory settings?

    I did an update on my ipad and now I have to restore it but it says I will lose everything How can I get my pictures on there before I restore my ipad to factory settings?

    They will be gone from the iphone, but you should be syning all contacts to your computer regularly and should be importing all pics to your computer regularly, particularly before any update.
    Have you failed to do this?

  • Can i get a number of rows in the select list??

    Hello~
    I am studying the "oracle call interface". but i don't know much about oci.
    Anyway i want to know that how can i get a number of rows.
    for example, there is a source code of the number of colums in the select list.
    The following is a list of DB(example)
    /*DB table*/
    ID NAME CODE ID
    1 A 1 A
    2 B 2 B
    /*source*/
    err = OCIAttrGet ((dvoid *) stmhp, (ub4)OCI_HTYPE_STMT, (dvoid*)
    &parmcnt, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, errhp);
    /*result*/
    The Column is 4. (ID, NAME, CODE, ID)
    So, i think that the row is 3 (ID, 1, 2) in the DB table.
    Simply, Can i get a number of rows in the select list??
    for example,
    err = OCIAttrGet ((dvoid *) stmhp, (ub4)OCI_HTYPE_STMT, (dvoid*)
    &parmcnt, (ub4 *) 0, (ub4)OCI_ATTR_RAW_COUNT, errhp);
    I'm trying to get the number of row count. but i can't find.
    Please, could you let me know that how can i get the number of row count.
    Thank you.

    Thank you for your reply.
    we are tested the source code by reply.
    The following is the test source code.
    /*source code*/
    strcpy (szStatement, "SELECT * from DB_TABLE");
    OCIStmtPrepare(gpOCIReadStmHandle, gpOCIErrHandle, szStatement,
         strlen(szStatement), OCI_NTV_SYNTAX, OCI_DEFAULT);
    OCIStmtExecute(gpOCISvcHandle, gpOCIReadStmHandle, gpOCIErrHandle,
         0, 0, 0, 0, OCI_DEFAULT);
    /* get a number of rows count , Reply : prajithparan*/
    OCIAttrGet((dvoid *)gpOCIReadStmHandle, OCI_HTYPE_STMT, (dvoid *)&nRowCount, NULL, OCI_ATTR_ROW_COUNT, gpOCIErrHandle))
    But There is a problem of the result value.
    The result value is 0. It's mean that the row count is 0. and then we are using the all of fuction is succeed.(return value)
    I don't know what is problem. Please let me know about the problem and solution.
    Thank you.

  • Urgent******how can i get the number of rows enterd by the user in a table

    Hi Frndz..
    As per my requirement i need to do the validations for the multipple rows in a table that was enterd by the user,
                   T
              The prob is how can i get that number of rows that enterd by user,
           WDMessageManager msg = wdComponentAPI.getMessageManager();
         String col1= "";
         String col2= "";
         double col3= 0;
         double col4= 0;
         double amount= 0;
         int nodesize = wdContext.nodeTest().size();
         try
         for(int i=0; i<=2 ; i++)
                   col1 = wdContext.nodeTest().getTestElementAt(i).getCol1();
                 //msg.reportSuccess("col1 size is :"+col1);
                   col2 = wdContext.nodeTest().getTestElementAt(i).getCol2();
                   col3 = wdContext.nodeTest().getTestElementAt(i).getCol3();
                   col4 = wdContext.nodeTest().getTestElementAt(i).getCol4();
                    amount = wdContext.nodeTest().getTestElementAt(i).getAmount();
              if(col1 == "" )
                        msg.reportException("Plz fil the col1 for line:",true);
                   break;
              else
              if(col2 == "" )
                                  msg.reportException("Plz fil the col2 for line:",true);
                             break;
                        else
              if(col3 <= 0)
                   msg.reportException("Plz fil the col3:",true);
                   break;
              else
                   if(col4 <= 0)
                   msg.reportException("Plz fil the col4:",true);
                   break;
              msg.reportSuccess("skvgjhdfgasdfgsjkafguisafisenvtvyeriy");
                                                       wdThis.test();
         catch (Exception e)
                   msg.reportException("strMessage in catch block",true);
         this is the code am going
    Regards
    Rajesh

    Hi,
       You can try this:
    * Let's say the table's datasource is a node called Table  and it has two attributes first & second.
    * You want to check if any of these attributes has been changed by the user or not. If they have been
    * changed then you want to do some validations against them.
      int sizeOfTable = wdContext.nodeTable().size();
      for(int i = 0; i < sizeOfTable; i++){
         IPrivate<view name>.ITableElement ele = wdContext.nodeTable().getTableElementAt(i);
         if(ele.isChangedByClient(ITableElement.<attribute name>)){
            //value has been changed, do some validation. You can get the row index using ele.index().
    Regards,
    Satyajit.

  • Downloaded ios5 one week ago, synced itunes and lost most apps, even folders and modified backup.  How can I get back what I had before last synced?

    Downloaded ios5 one week ago, last nigth synced itunes and lost most apps, even folders and modified backup.  How can I get back what I had before last synced?

    Try resetting your home screen layout, go to your setting>general>reset home screen layout. 

  • How can i get my money back on my visa card and delet my song?

    i need to now how can i get my money back on my visa card and delet the song?

    All sales are final

  • HT204382 I was attempting to upload a video to face book and decided to cancel, now I can not get the quicktime icon with Facebook icon embedded to delete? what are steps to clear desktop?

    I was attempting to upload a video to face book and decided to cancel, now I can not get the quicktime icon with Facebook icon embedded to delete? what are steps to clear desktop?

    A warm welcome to Apple discussions!
    A 2003 iMac cannot support Snow Leopard 10.6; you'd need an Intel processor and that cannot be retrofitted to your Mac. What does "About this Mac" in your Apple menu say  for your processor speed? What does it say about how much RAM you have?
    If the processor is 1ghz or faster, you can run OS 10.5; otherwise, you are maxed out at 10.4.11.
    Also, are you running any commercial ("pay for") anti-virus or security software? They are notorious for slowing most Macs to a fraction of their speed potential.
    A too-full hard drive can drag down performance, especially if you don't have a lot of physical RAM installed. If you single-click your hard drive icon and then do command i, you'll see the disk usage. Looks like this:
    The value for "Used" should be no more than about 90 percent of "Capacity." In the example image, that drive has about 34 percent of its space used and 66 percent free--more than enough. Please post what you see for your Capacity and Used numbers
    There are a few more things we might check but this is a good start.
    Awaiting your information,
    Allan

  • Can not get email after updating to 8.1.1! Deleted account and now cannot add as will not verify due to Apple something timeout messages? Any one else having problems?

    Can not get email after updating to 8.1.1! Deleted account and now cannot add as will not verify due to Apple something timeout messages? Any one else having problems?

    Hi tania184,
    Have you contacted your email provider to make sure there are no problems on their end? If they say their email servers are working properly, check the outgoing and incoming mail servers entries on your iPhone to make sure both are entered correctly. Enter the outgoing mail server even if the account setup indicates that is optional.

  • Where does Mail keep its hidden cache of auto-complete email addresses.  I am plagued with an incorrect email adress I can't get rid of.  Have made sure it's deleted from Contacts and made sure it's deleted from "previous recipients" list in Mail - i

    Where does Mail keep its hidden cache of auto-complete email addresses.  I am plagued with an incorrect email address I can't get rid of.  Have made sure it's deleted from Contacts and made sure it's deleted from "Previous Recipients" list in Mail.  But it still keeps reappearing ... obviously a secret cache file hidden somewhere?

    Autocomplete has nothing to do with this problem.
    From the Mail menu bar, select
              Window ▹ Connection Doctor
    Look for a disused SMTP (outgoing mail) account in the window that opens. Double-click it. Another window will open, showing a list of all the outgoing mail accounts. The unwanted one will be selected. Click the minus-sign button to delete it, then click OK.
    If there's more than one unwanted account, repeat.

  • Can not get data from database

    hi all,
        there is a problem ,  when i write like below :
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
              WHERE bukrs = p_bukrs
                AND hkont = p_hkont.
    p_bukrs , p_hkont are all on the selection screen , and p_bukrs = 1200 another is eq blank. i can not find any data , but with the same condition i can find some data in database , when i debeg i found that p_hkont is initial.
        when i write like this :
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
              WHERE bukrs = p_bukrs .
    this time i can find the data like the database.
        so , does someone know where the problem is , why i can not get data ?
    kind regards
    kevin

    hi,
    if u r  using bukrs and hkont as parameters in selection screen then
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
    WHERE bukrs = p_bukrs
    AND hkont = p_hkont.
    this will work.
    if u r using then as select-option then the above does n't work.
    bcoz select-options work as internal table bcoz of that u have use the query like this
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
    WHERE bukrs IN p_bukrs
    AND hkont IN p_hkont.
    <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
    Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:25 PM

  • How can I get the number of rows in my sql result, without a loop?

    Hello,
    I've a problem, I would like to get the number of rows in my sql result without make a loop like :
    while (rs.next()){
    int number = rs.getRow();
    Is there any method to do this, on the first element?
    Thx, STeF

    If you want to count how many rows are in result set, I dont think you can, but you could always run a count statement for that sql
    say your sql is
    select field1, field2, field3
    from table1, table2
    where field4=field5 ......
    then you can count the rows this statement returns by
    select count(*) from
    (say your sql is
    select field1, field2, field3
    from table1, table2
    where field4=field5 ......)
    This way you will get the count for just that sql

  • How can i get the details on system before 2 months

    Hi gurus,
              To find the Total cpu time ,  cummulative users  we go for St03 and extract it. The details are available for only last 2 months.  How can i get the prevous months details. Is there any special job or parameter meant on SAP behalf, so tat it clears the history. If it runs kindly tel me wat job or parameter it is. And also tel how can i get the previous months details.
    Thank you.
       Livi.
    Moderator message: not directly related to ABAP development, please have a look in the Netweaver forums.
    Edited by: Thomas Zloch on Jan 5, 2011 11:43 AM

    Hi
    U should ask that to your basis, I know the system has the statistic data for a certain period only, the older data are deleted: I don't know if before deleting it a backup is done....but I don't believe
    Max

  • Issues installing BO XI R 3.0 - Can't get passed CMS Database Information

    I can't get passed the CMS Database Information window from the install:
    I'm choosing an existing CMS database via Oracle.  This CMS is also being used on a different server, is this an issue?  I'm trying to do a side-by-side installation of which I chose a different directory.  For the CMS port I chose 6500, since my other install of BO XI Release 2.0 CMS is using 6400. 
    I'm getting Assert Failure's in the Trace_dbcheck.log:
    Timestamp     ProcessID     ThreadID     Message
    [Mon Aug 04 14:30:58 2008]     5212     8160     trace message: findDFA_LLR: [CmdLineDir] Y:\BO XI R3\package\dbcheck
    sqlrule.llr
    [Mon Aug 04 14:30:58 2008]     5212     8160     trace message: Loading: database subsystem only
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: loading libary succeeded
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: DatabaseSubsystem::Init()
    [Mon Aug 04 14:30:59 2008]     5212     8160     (d:\titan_rtm\src\framework\libs\cpp\dbwrapper\oracle\OracleXPlatWTF.h:94): trace message: Loading Oracle libclntsh client library.
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\wireobinit.cpp:96): trace message: Creating the shared CWireObject::PropertyNameMap
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\wireobinit.cpp:118): trace message: Setting static property map
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\wireobinit.cpp:125): trace message:  CWireObject::InitializeStaticPropertyMap() - reference count: 1
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: initializing subsystem succeeded
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: Loading: done loading subsystem - database subsystem only
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: DatabaseSubsystem::Connect()
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\DBConnectionManager.cpp:802): trace message: DBConnectionManager - Setting total target number of connections for pool 0 to 1.
    [Mon Aug 04 14:30:59 2008]     5212     8160     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\dbutils.cpp:820): trace message: Caught Unknown Error: Internal error: An unknown exception has occurred.
    [Mon Aug 04 14:30:59 2008]     5212     8160     trace message: DatabaseSubsystem::Shutdown()
    [Mon Aug 04 14:30:59 2008]     5212     8160     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\DBConnectionManager.cpp:719): trace message: Database error while shutting down database: Programmer error. Check ASSERT log.
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\wireobinit.cpp:175): trace message: CWireObject::TerminateStaticPropertyMap() - reference count: 1
    [Mon Aug 04 14:30:59 2008]     5212     8160     (.\wireobinit.cpp:182): trace message: Releasing static property map

    Hi Tony,
    I did try to create a new SIA with the default servers, and I got the following error:
    Central Configuration Manager:
    Internal error: An unknown exception has occurred.
    In the SvcMgr_20080806_163542_4124.log I got the same error I've been getting from the beginning:
    [Wed Aug 06 16:37:59 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:37:59 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:11 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:11 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:18 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:18 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:57 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:38:57 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:40:56 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:40:56 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:44:21 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:44:57 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:45:56 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:45:56 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:46:04 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 16:46:04 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 18:44:09 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    [Wed Aug 06 18:44:09 2008]     4124     2360     assert failure: (.\OracleDatabase.cpp:117). (0 : Programmer error: OCI_INVALID_HANDLE).
    I just noticed the boe_upgrade_output.xml file that all the directories show the path to my original Business Objects XI R2, when I specified a different directory.  Just a little confused by this.

  • Can't get a new database connection

    We keep on getting following JAVA Stack from our Web Application.
    It access an ORACLE database and seems to say the DB IS DOWN [but its NOT!].
    My real question is: WHat can cause these erors? => like "Can't get a new connection" ?
    UPDATE
    =======
    JAVA Stack:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    com.emeta.erights.api.exceptions.TracedRemoteException: RMI TCP Connection(29918)-194.128.151.62
    com.emeta.erights.util.jdbc.exceptions.PreparedStatementException: Can't get a new connection
    at com.emeta.erights.util.jdbc.PreparedStatementPool.startTransaction(PreparedStatement
    Pool.java:297)
    at com.emeta.erights.util.jdbc.JDBCConnectionPool.executeQuery(JDBCConnectionPool.java:641)
    at com.emeta.erights.offers.coupon.CouponData.get(CouponData.java:262)
    at com.emeta.erights.offers.coupon.CouponData.getClientObject(CouponData.java:882)
    =====================
    Terry

    You may have simply run out of database connections. Check to see how many your DB allows, and see how many are in use when you start getting this.
    Dave.

Maybe you are looking for