Perform a COMMIT during a DB lock

Hi experts,
I have locked certain fields of a DB table using a lock object (called the FM ENQUEUE_XXXX). After successfully executing the FM,  I need to update a table which is not affected by the lock object and save the changes with a COMMIT WORK. Things are not working as I wish because in debugging mode I have observed that the table is updated after I release the lock object (call FM DEQUEUE_XXXX). Can it be that I'm setting a wrong parameter during the call of the FM ENQUEUE_XXXX? The lock type I'm setting is E.
Thanks in advance for your help,
Jaime

Moderator message - Welcome to SCN.
SAP locks using ENQUEUE and DEQUEUE FMs are logical locks not physical. But a COMMIT is hard. once you do a COMMIT, the database should be updated. How do you tell that it is not?
Rob

Similar Messages

  • BI ABAP Issue regarding perform on commit statement

    Hi,
    I have a requirement like below.
    I have a test to see if SAP issues a COMMIT WORK at the end of the datapacket, and allows update tasks to be executed .and check whether the second datapacket succeed in getting the lock, or fail because it has not been dequeued.
    For this i have written code in the end routine of DTP like below.
    1. Called enqueue fm
    2. Created a custom table and taken loop at result_package and get the values to the internal table.
    3. I have created an updated function module to call perform on commit inside the function module. Since we canu2019t directly call the commit work in the end routine of DTP. And in the form endform i am updating the custom table from internal table.
    4. Called dequeued fm.
    But the issue is i am notable to bedug the code (perform <form name> on commit) (cursor is not going to the inside the perform) inside the function module even though i enabled the update task in debugger setting and used F9 to set the FM for debug.
    Can any body help me on this
    Thanks,
    Nagendra

    did you try by setting a manual break-point inside the code and then going step by step (by pressing F5) ?

  • Issue regarding perform on commit statement

    Hi,
    I have a requirement like below.
    I have a test to see if SAP issues a COMMIT WORK at the end of the datapacket, and allows update tasks to be executed .and check whether the second datapacket succeed in getting the lock, or fail because it has not been dequeued.
    For this i have written code in the end routine of DTP like below.
    1. Called enqueue fm
    2. Created a custom table and taken loop at result_package and get the values to the internal table.
    3. I have created an updated function module to call perform on commit inside the function module. Since we canu2019t directly call the commit work in the end routine of DTP. And in the form endform i am updating the custom table from internal table.
    4. Called dequeued fm.
    But the issue is i am notable to bedug the code (perform <form name> on commit)  (cursor is not going to the inside the perform) inside the  function module even though i enabled the update task in debugger setting and used F9 to set the FM for debug.
    Can any body help me on this
    Thanks,
    Nagendra

    did you try by setting a manual break-point inside the code and then going step by step (by pressing F5) ?

  • Perform on commit

    Hi,
    can you show me an example of "perform on commit" with variables.

    Hi,
    PERFORM ON COMMIT routines are not executed in the dialog module.
    You must ensure that any subroutines called using ON COMMIT can be delayed until the next COMMIT WORK in the calling program. Remember that the global data of the dialog module is destroyed along with the internal session when control returns to the calling program. Consequently, subroutines called using PERFORM ON COMMIT must not use this global data.
    The statement PERFORM ON COMMIT calls a subroutine in the dialog work process. However, it is not executed until the system reaches the next COMMIT WORK statement. Here, as well, the ABAP statement COMMIT WORK defines the end of the SAP LUW, since all statements in a subroutine called with PERFORM ON COMMIT that make database changes are executed in the
    database LUW of the corresponding dialog step.
    The advantage of this bundling technique against CALL FUNCTION... IN UPDATE TASK is better performance, since the update data does not have to be written into an extra table. The disadvantage, however, is that you cannot pass parameters in a PERFORM... ON COMMIT statement. Data is passed using global variables and ABAP memory. There is a considerable danger of data inconsistency when you use this method to pass data.
    You can also put the CALL FUNCTION IN UPDATE TASK into a subroutine and call the subroutine with:
    <b>PERFORM SUBROUT ON COMMIT.</b>
    If you choose this method, the subroutine is executed at the commit. Thus the request to run the function in the update task is also logged during commit processing. As a result, the parameter values logged with the request are those current at the time of the commit.
    Ex.
    a = 1.
    PERFORM F ON COMMIT.
    a = 2.
    PERFORM F ON COMMIT.
    a = 3.
    COMMIT WORK.
    FORM f.
    CALL FUNCTION 'UPD_FM' IN UPDATE TASK EXPORTING PAR = A.
    ENDFORM.
    In this example, the function module UPD_FM is carried out with the value 3 in PAR. The update task executes the function module only once, despite the two PERFORM ON COMMIT statements. This is because a given function module, logged with the same parameter values, can never be executed more than once in the update task. The subroutine itself, containing the function module call, may not have parameters.
    Regards,
    Bhaskar

  • Re: perform on commit

    Hello Friends,
    I want to write perform on commit. 
    but can anyone tell me what is the syntax whils writing it as perform?
    and while writing form and endform.
    it's urgent , plz.

    In your BADI submit a function module [IN BACKGROUND TASK|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=inBACKGROUNDTASK&adv=false&sortby=cm_rnd_rankvalue] to update the second infotype via FM [HR_INFOTYPE_OPERATION|https://www.sdn.sap.com/irj/scn/advancedsearch?query=hr_infotype_operation&cat=sdn_all] (create a RFC enabled Z-FM that call the standard FM)
    Regards

  • Nested perform on commit error

    hi all,happy new year 2006
    in my custom transaction upon save,
    iam calling a Func module in update task passing all the internal tables which contain the update data.
    inside this FM iam doing table updates without commit and also calling change document funcs ( open,single/multiple case/close) to update the CDHDR and CDPOS tables.
    iam also calling BAPI_SALESORDER_CHANGE inside this update task FM. after the call iam calling BAPI_TRANSACTION_COMMIT.
    Iam getting an update task termination message saying that there are nested perform on commit statements happenening in some some SAP prog call and therefore it causes a dump. i have seen that the fm 'CHANGEDOCUMENT_CLOSE' calls a 'perform on commit'.
    but not able to figure out where exactly is the problem.
    any suggestions.
    thanks a lot.

    Hi KP!
    I'm sure you can't call BAPI_TRANSACTION_COMMIT in an update task - there a commit is a forbidden statement.
    I had a short look at CHANGEDOCUMENT_CLOSE:
    *    don't call this form on COMMIT when you are already in a form on
    *    commit
        IF sy-oncom = 'P'.
          PERFORM swe_event_create_changedocumnt.
        ELSE.
          PERFORM swe_event_create_changedocumnt ON COMMIT.
        ENDIF.
    At least here (and on release 640, ERP 5.0) a different coding for update tasks is executed.
    Do you have a shortdump, where you can check exact place of the nested call? Or is this a generation error -> again try to check exact place.
    Regards,
    Christian

  • Perform ON COMMIT doesn't work (Try it)

    Has anyone tried a PERFORM ON COMMIT within a BADI? It doesn't work and i don't know why.
    I am working with the HR Module, and i have a BADI, which is fired when the user hits the 'SAVE' button (PA30 Transaction).. when this happens, i execute a PERFORM ON COMMIT and the subroutine is never called...
    Does anyone know anything about this?
    Regards

    In your BADI submit a function module [IN BACKGROUND TASK|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=inBACKGROUNDTASK&adv=false&sortby=cm_rnd_rankvalue] to update the second infotype via FM [HR_INFOTYPE_OPERATION|https://www.sdn.sap.com/irj/scn/advancedsearch?query=hr_infotype_operation&cat=sdn_all] (create a RFC enabled Z-FM that call the standard FM)
    Regards

  • Java.sql.SQLException: You cannot commit during a managed transaction!

    Hi all,
    I'm just trying to get the tutorial Car EJP app to work with Jboss 3.2.1
    When creating a new car record by calling the car.edit() method it reaches
    the line
    pm.makePersistent (car);
    and then throws the exception
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    java.sql.SQLException: You cannot commit during a managed transaction!
    [code=0;state=null]
    When checking the jboss log, it is clear that kodo is trying to commit the
    sequence update :
    at
    org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:477)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.commit(SQLExecutionManagerImpl.java:783)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory.updateSequence(DBSequenceFactory.java:267)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory.getNext(DBSequenceFactory.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newDataStoreId(JDBCStoreManager.java:598)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1418)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:1348)
    at com.titan.kodojdotest.ejb.CarBean.edit(CarBean.java:51)
    How should i get this to work ????
    tx for your help,
    Roger.

    It appears that you are using ConnectionFactoryName. First be sure to
    set a ConnectionFactory2Name which will be a non-transactional (in terms
    of global transaction) DataSource for sequence generation for which you
    are seeing here. There are also some issues with JBoss's connection
    pooling on certain dbs if you are still seeing the problem after this.
    If so, try setting ConnectionURL, ConnectionPassword, etc explicitly
    Roger Laenen wrote:
    Hi all,
    I'm just trying to get the tutorial Car EJP app to work with Jboss 3.2.1
    When creating a new car record by calling the car.edit() method it reaches
    the line
    pm.makePersistent (car);
    and then throws the exception
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    java.sql.SQLException: You cannot commit during a managed transaction!
    [code=0;state=null]
    When checking the jboss log, it is clear that kodo is trying to commit the
    sequence update :
    at
    org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:477)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.commit(SQLExecutionManagerImpl.java:783)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory.updateSequence(DBSequenceFactory.java:267)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory.getNext(DBSequenceFactory.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newDataStoreId(JDBCStoreManager.java:598)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1418)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:1348)
    at com.titan.kodojdotest.ejb.CarBean.edit(CarBean.java:51)
    How should i get this to work ????
    tx for your help,
    Roger.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Cannot commit during managed transaction

    Using Kodo 2.5.2, JBoss 3.2.1, and the DefaultDS datasource (HSQL)
    provided by JBoss, I'm getting the following exception when calling
    PersistenceManager.makePersistent:
    java.sql.SQLException: You cannot commit during a managed transaction!
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLEx
    ceptions.java:58)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.handle(SQLExcept
    ions.java:43)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newDataStoreI
    d(JDBCStoreManager.java:562)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFil
    ter(PersistenceManagerImpl.java:1450)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistent(Pe
    rsistenceManagerImpl.java:1380)
    Any idea why?
    -Chris

    Using Kodo's connection pooling fixed the problem.
    Thanks for the help.
    Chris West wrote:
    I suspect JBoss connection pooling could be the problem. A couple of
    questions...
    1. Do you know which versions of JBoss have this problem.
    2. How do I configure Kodo to use it's own connection pool on JBoss?
    -Chris West
    Stephen Kim wrote:
    I would highly suggest using Kodo's connection pool first and see if
    that alleviates the problem. I recall JBoss having some connection pool
    issues in certain versions.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Does a mac perform self diagnostics during sleep mode?

    does a mac perform self diagnostics during sleep mode? I was told it does about 10 years ago.

    Russa wrote:
    .. but it you leave it on at night, the OS will run the Unix CRON maintrenance routines.. during 3:15 and 5:30am (not in Sleep mode), the cron tasks will be run.
    http://support.apple.com/kb/HT2319
    Russa, from the KB article you linked notice that those maintenance scripts are no longer invoked by cron. They are invoked by launchd:
    Additional Information
    The tasks are scheduled for 03:15 to 05:30 in your computer's local time zone. This is described further in "Mac OS X: Unexplained Disk Activity Produced by 'find' Process." These tasks do not run if the computer is shut down or in sleep mode. If the tasks do not run, it is possible that certain log files (such as system.log) may become very large in Mac OS X v10.5 or earlier.
    Therefore no user intervention is required, unless you are running Mac OS X "Leopard" or earlier.
    It may seem overly pedantic to bring this up but this common misconception has a tendency to lead people into believing a Mac requires the user to perform maintenance over and beyond what OS X already accomplishes by default.
    As others have written, a Mac takes care of its own housekeeping. It is best to simply let it work as designed.

  • Is It Possible to use Call Function in update task in perform on commit

    Hi Friends,
    I have to send an email once the commit work is done. so i am writing code like this,
    Perform send_email on commit.
    form send_email.
    call function 'SO_NEW_DOCUMENT_SEND_API1' in update task
    endform.
    endform.
    .... ( Some other code)
    commit work.
    But, I am getting error saying Update task is not possible. Please suggest me how to solve this.
    Thanks in Advance,
    Phani.

    Hi Phani,
          Check whether <b>COMMIT Work</b> has be performed. I think this might be the problem.
    Regards,
    Prashanth

  • Wat is perform on commit

    Plz give reply to me

    Hi
    This is used to commit the changes to the database
    when you write some code in the PERFORM ..ON COMMIT
    subroutine, all the statements reagrding database update are committed only when you write explicit COMMIT WORK  and for Roll back  ROLLBACK  has to be used.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Interrupt a perform-on commit.

    Hi all,
    How to interrupt a perform which is done on ON-COMMIT statement.
    Will the ROLLBACK WORK will effect..
    Thanks & Regards,
    Neslin.

    Hi,
    You can use the abort message to stop processing..
    MESSAGE A208(00) WITH 'PERFORM FAILED'.
    Thanks,
    Naren

  • Downloading screen appears during app and locks screen

    In the middle of an app (New York Times crossword puzzle), the downloading icon appears and my system locks. I have to exit the app and close it. When I restart the app, the downloading icon goes away. Is this an app problem or an iPad Mini problem? Suggestions? Thanks

    Hello Gerald,
    Thank you for providing the details of the issue you are experiencing with the New York Times Crosswords app (one of my personal favorites) on your iPad.
    I recommend following these steps for an issue like the one you described (you can skip 4 because it does not relate to the issue you are experiencing and any other steps you may have taken):
    If a single application is not responding or stops responding when it opens, you can force it to close.
    If the device is unresponsive or if certain controls aren't working as expected, restart your device.
    If the device remains unresponsive or does not turn on (or power on),reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more about restoring iOS software.
    If the device doesn't appear in iTunes, try to force the device into recovery mode, and then restore it.
    If the above steps do not resolve the issue, contact Apple.
    You can find the full article here:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    If you get to step 5, I recommend backing up your iPhone before performing the restore:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/HT1766
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Editing a large PHP file, using {, }, (, ), or comma causing DW to lock-up

    I have a PHP file totalling around 7,000 lines of code. When I write { or }, ( or ), or a comma, at any point in the file, DW locks-up for a few seconds, then continues. This has been happening ever since I started using Dreamweaver CS4 - it never occurred with older versions.
    Any ideas?
    [Post moved to more appropriate forum -Forum Moderator]

    I don't have PHP files that are as long as that, so have no way of testing. However, one possibility is that Syntax Error Alerts are turned on. Dreamweaver CS4 doesn't check for PHP syntax errors; the syntax checker is for JavaScript. However, having the option turned on might cause the problem, because PHP and JavaScript both use braces and parentheses. Try turning off real-time syntax checking. It's toggled on and off by clicking the button in the Coding toolbar, as shown in the following screenshot:
    When turned on, the button looks pressed in like the two immediately above it in the screenshot.
    If that doesn't improve the situation, I suggest that you file a report to the Dreamweaver engineering team through the bug report form at http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform. Give as much detail as possible to help the engineers try to reproduce the problem.

Maybe you are looking for