Transaction resources not released across program invocations using MVCC

I'm evaluating Berkley DB XML v2.4.13 for use in a new software product and have encountered problems with multiversion concurrency control.
I'm using the Java API and JRE 1.6.0_07. The platform is Windows XP Professional SP3.
When I create a transaction with snapshot isolation enabled, execute some XQueries that read/update the contents of a document and then commit or abort it, the resources allocated to the transaction do not appear to get released. I've used EnvironmentConfig.setTxnMaxActive() to increase the number of active transactions allowed but this just allows me to run my program more times before it eventually hangs.
When I set EnvironmentConfig.setTxnMaxActive() to a small number the program hangs before completing the first time I run it. When I set
EnvironmentConfig.setTxnMaxActive() to a high value then I can run my program several times before it hangs. Note that the program runs to
completion and exits cleanly. I used the task manager to verify that all processes started by the program are gone when it completes. So
it appears that the resources allocated to a transaction are persisted in the database across program invocations. As a result the program
eventually hangs after running it several times. The number of times it can be run before hanging is directly proportional to how many active
transactions I've set with EnvironmentConfig.setTxnMaxActive(). It appears as if I'm not shutting down the environment cleanly but I've
read the documentation several times and am following the examples exactly. I've committed every transaction and have closed the XmlContainer,
XmlManager and the Environment.
When I use read-uncommitted, read-committed or serializable transaction isolation everything works fine. I'm only seeing this problem when
I use snapshot isolation. Am I doing something wrong or is this a known problem? If this is a known problem is there a work around?
Here's a copy of the program source code. Thanks in advance for any help you can provide.
package dbxml;
import java.io.File;
import com.sleepycat.dbxml.*;
import com.sleepycat.db.*;
public class txn
public static void main(String args[])
double partId = Double.parseDouble(args[0]);
int partCnt = Integer.parseInt(args[1]);
XmlTransaction txn = null;
Environment myEnv = null;
XmlManager myManager = null;
XmlContainer parts = null;
XmlQueryExpression qe;
XmlResults results;
XmlQueryContext context;
String readQry = "collection('parts.dbxml')/part[@number=$partId]";
String updQry = "replace value of node collection('parts.dbxml')/part[@number=$partId]/description with $desc";
try
EnvironmentConfig envConf = new EnvironmentConfig();
// If the environment doesn't exist, create it.
envConf.setAllowCreate(true);
// Turn on the transactional subsystem.
envConf.setTransactional(true);
// Initialize the in-memory cache
envConf.setInitializeCache(true);
// Initialize the locking subsystem.
envConf.setInitializeLocking(true);
// Initialize the logging subsystem.
envConf.setInitializeLogging(true);
envConf.setLockDetectMode(LockDetectMode.MINWRITE);
envConf.setLockTimeout(5000);
envConf.setTxnMaxActive(200);
envConf.setCacheMax(10000);
envConf.setMaxLocks(10000);
envConf.setMaxLockers(10000);
envConf.setMaxLockObjects(10000);
File envHome = new File("./dbxml/src/dbxml/dbhome");
myEnv = new Environment(envHome, envConf);
XmlManagerConfig managerConfig = new XmlManagerConfig();
managerConfig.setAdoptEnvironment(true);
myManager = new XmlManager(myEnv, managerConfig);
XmlContainerConfig containerConf = new XmlContainerConfig();
containerConf.setTransactional(true);
containerConf.setAllowCreate(true);
// Turn on container-level multiversion concurrency control
containerConf.setMultiversion(true);
parts = myManager.openContainer("parts.dbxml", containerConf);
TransactionConfig txnConfig = new TransactionConfig();
// set the transaction isolation-level
txnConfig.setSnapshot(true);
for (int i = 0; i < partCnt; i++, partId++)
// start a transaction
txn = myManager.createTransaction(null, txnConfig);
context = myManager.createQueryContext();
context.setVariableValue("partId", new XmlValue(partId));
context.setVariableValue("desc", new XmlValue(System.currentTimeMillis()));
qe = myManager.prepare(txn, readQry, context);
results = qe.execute(txn, context);
while (results.hasNext())
String part = results.next().asString();
System.out.println(part);
results.delete();
qe.delete();
// Prepare (compile) the query
qe = myManager.prepare(txn, updQry, context);
results = qe.execute(txn, context);
txn.commit();
results.delete();
qe.delete();
txn.delete();
txn = myManager.createTransaction(null, txnConfig);
qe = myManager.prepare(txn, readQry, context);
results = qe.execute(txn, context);
while (results.hasNext())
String part = results.next().asString();
System.out.println(part);
txn.commit();
results.delete();
context.delete();
qe.delete();
txn.delete();
catch (Exception e)
try
if (txn != null)
txn.abort();
catch(XmlException xe)
xe.printStackTrace();
e.printStackTrace();
finally
try
System.out.println("Shutting Down ...");
if (parts != null)
System.out.println("Closing Container");
parts.close();
if (myManager != null)
System.out.println("Closing Manager");
myManager.close();
System.out.println("Shut Down Complete");
catch (Exception xe)
xe.printStackTrace();
}

From the documentation I linked for you:
The environment should also be configured for sufficient transactions
using [DB_ENV-&gt;set_tx_max|http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_tx_max.html]. The maximum number of transactions
needs to include all transactions executed concurrently by the
application plus all cursors configured for snapshot isolation.
Further, the transactions are retained until the last page they created
is evicted from cache, so in the extreme case, an additional transaction
may be needed for each page in the cache. Note that cache sizes under
500MB are increased by 25%, so the calculation of number of pages needs
to take this into account.As you can see, to calculate the maximum number of transactions you should configure for, you should use the following formula:
number_of_txns = cache_size / page_size + number_of_concurrently_active_transactionsThis will give you a worst case figure - in practice you may find that a lower number will suffice.
You'll also notice that transactions remain allocated "until the last page they created is evicted from the cache", so you should find that checkpointing will also reduce the number of transactions necessary at any one time.
Using snapshot semantics only on read-only operations will give you the full value provided by MVCC. This means that the read-only (snapshot) transactions will take copies (snapshots) of the pages that are write-locked, but the transactions that write will wait on the write-lock. Using snapshot semantics this way will reduce deadlocks as intended - using snapshot semantics for write transactions just introduces [a new way to get a deadlock|http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/txn_begin.html#DB_TXN_SNAPSHOT]:
The error DB_LOCK_DEADLOCK will be returned from update operations if a snapshot transaction attempts to update data which was modified after the snapshot transaction read it.John

Similar Messages

  • EJB3 : suspend JTA transaction does not release the connection in the XA DS

    Hi all,
    I did a test and after suspending a JTA transaction I note that in the xa datasource the activeconnection = 1.
    So is it normal because I was thinking that when I suspend the transaction the teh connection is released and then after a transaction resume I could continue the transaction with another connection of the xa datasource ?
    Thank you for all..
    Christophe.

    It's a long time ago, but did you ever solve this problem?
    I'm having the same issue with OSB writing to a WLS8.1 JMS queue.
    I have a development OSB server which works fine.
    Pete

  • Calling a transaction code in between the program and use the output

    Hi frnds,
              i want to call a transaction code in between the program   and pass the input .After getting the output, use that output in the program

    Hi Navin,
                     Why don't you sit with ABAPer he can explain better.
    Regards,
    HAri.

  • Oci_close does not release the connection when using DRCP

    Hello everyone,
    we are currently testing the deplyment of DRCP with 11g. I have the whole thing setup (correctly to my best knowledge), but I am facing an issue. The call to oci_close does not seem to release the connection to the pool as I would expect and therefore we see similar behavior like we were getting without using the DRCP.
    Our setup is using two RAC instances running 11.1.0.6.0, I am using PHP 5.1.6 with PECL installed oci8 1.3.4. The DRCP pool is configured and started, each with 100 max servers.
    When the webserver is idle it looks, well, idle.
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 0
    2 0
    The script is as simple as it gets:
    <?php
    $c = oci_pconnect('scott','tiger','IWPPOOLED');
    $s = oci_parse($c, 'select * from emp');
    $r = oci_execute($s, OCI_DEFAULT);
    oci_close($c);
    sleep(30);
    ?>
    What I would expect is that the script would connect to the pool, do the work for a tiny moment and then release the connection for usage by other script.
    But after I point the browser to the script, I get a 30 second loading time (as expected) but the server is busy all the time, like this:
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 0
    2 1
    After the 30 second sleep, it is released and busy servers are back to 0.
    If I load the server with ab using 256 connections:
    ab -n 1000000 -c 256 -k http://mywebserver/ocitest.php
    the pool is maxed out and the connects are stalling:
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 95
    2 95
    My network config for this service is following:
    IWPPOOLED =
    (DESCRIPTION =
    (LOAD_BALANCE=ON)
    (FAILOVER=ON)
    (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.33)(PORT = 1521))
    (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.34)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = IWP)
    (SERVER=POOLED)
    (FAILOVER_MODE=
    (TYPE=SELECT)
    (METHOD=BASIC)
    (RETRIES=5)
    (DELAY=3)
    The phpinfo() look like this:
    OCI8 Support enabled
    Version 1.3.4
    Revision $Revision: 1.269.2.16.2.38.2.20 $
    Active Persistent Connections 1
    Active Connections 1
    Oracle Instant Client Version 11.1
    Temporary Lob support enabled
    Collections support enabled
    Directive Local Value Master Value
    oci8.connection_class IWPAPP IWPAPP
    oci8.default_prefetch 100 100
    oci8.events On On
    oci8.max_persistent -1 -1
    oci8.old_oci_close_semantics Off Off
    oci8.persistent_timeout -1 -1
    oci8.ping_interval -1 -1
    oci8.privileged_connect Off Off
    oci8.statement_cache_size 20 20
    I am using the instant client for 11g
    Any ideas?
    Thanks!
    Michal

    Don't forget to use oci_free_statement($s); See "Closing Oracle Connections" in The Underground PHP and Oracle Manual. (I was just simplifying this example today for the next release of the manual).
    You may also see the "dedicated optimization", where a pooled server in a non- maxed-out pool is retained (unless needed by another PHP process) under the assumption that the initial PHP process might become active again. See http://www.oracle.com/technology/tech/php/pdf/php-scalability-ha-twp.pdf
    Feel free to email me offline (see my profile) if there are questions/data you don't want to post.
    cj
    Edited by: cj2 on Oct 16, 2008 8:12 AM

  • In Configurator 1.1 it's not releasing initial VPP code used to first get app

    I had been using Configurator off-and-on for a little while to manage 5 iPads.  I would download a VPP xls file with 5 codes in it, use the first code to download the app from iTunes in order to get it into Configurator, then upload the codes into Configurator.  It would then release the initial code so that i still had 5 available.  I just bought two new apps (5 codes for each), uploaded them to Configurator and when i synced the iPads it only did 4 and told me that one of the codes was already used.  Anyone else seen this?
    Thanks

    There is certainly something up in this version.  This time i bought 6 codes for my 5 ipads so that if it didn't release the initial one again i would still have enough codes.  Well, THIS TIME it worked normally and i have an extra code.  ??? 
    Also, i added another code to the app i initially had problems with (Atomic Web) so that i could have the 5 that i need and Configurator sees it as not recognized as a valid code for some reason.  This is frustrating.

  • Resource not release when starting/stopping the deployed application

    I am testing to deploy an standard web application on Weblogic 11gR1 at Windows XP. It is running and everything is working fine. But I noticed below situation which concersns about the release of resouce during stop and start deployed application by using Admin Server Console:
    After the deployed application starting running in Weblogic, I go to Admin Server Console to select the deployed application at deployment section and click "stop\When work complete". It looks like that the deployed application was stopped and its state went to "Prepared". Then I start it again by click "Start\Servicing all requests". It started correctly. If I tried multiple times of "Start \ Stop" operations on this deployed application, then eventurally, I got "output memory" exception and Weblogic died. I wached the memory usage of Weblogic, when applying multiple times of 'start / stop' operation on an deployed application, the memory usage of weblogic continuese to grow and until "output memory" exception occurs.
    Is it normal? What might be wrong when configuring weblogc? or somethng wrong for deployed application?
    Anybody can provide any help would be great appreciated.
    Thanks in advance.
    Jim

    Hi Mithun,
    Thanks for your reply! If stopping the deployment need some time to finish, So, admin console of weblogic should disable ( grey out ) its starting button while the related deployed application is still shutting down. After the deployed application were stopped completely, then enable the starting button again to avoid the issue.
    I just feel a little bit strange for the admin console of Weblogic to behavior on start / stop deployed application.
    Thanks,
    Zhiping

  • My membership transaction was not made, now I cannot use my Adobe tools.

    What now?

    Hi Hawksenk,
    Welcome to the Adobe Forums,
    Please update the state province in your adobe.com account under your account details. Try placing the order after updating & refreshing the Adobe Account.
    Please let me know if it worked.
    Regards
    Rajshree

  • NMAT order not release

    Hi SAP experts,
    I want those process orders which have status NMAT not release for production by using user status BS02.
    I tried by using system status (BS22) for 10485 to make the release forbidden still it is not working .please advice.
    Thanks in advance
    Regards,
    Rahul

    Hi Rahul,
    Business transaction 'BFRE' (Release), select radio button 'Forbidd.'.
    Business transaction 'RMTF' (Partially release order) select radio button 'Forbidd.
    Regards,
    R.Brahmankar

  • Transaction code not defined

    HI Guru's,
    I have a little problem, when I do a
    SUBMIT rkaep000
        WITH SELECTION-TABLE i_tab
         TO SAP-SPOOL
    I receive the following error message : "Transaction code not defined"
    When I try also to run alone the program "rkaep000" se38, I receive the same error.
    Anybody have a solution?
    Regards,
    MohameD.

    Use call transaction method. Call the program by using following relevent t-code.
    T-Code      program                                                                                Description
    CJIG     RKAEP000     800          80          Display PS Cash Documents
    CPB1     RKAEP000     120          80          Business Processes: Act. Line Items
    CPBP     RKAEP000     220          80          Business Processes: Plan Line Items
    KABP     RKAEP000     400          80          Controlling Documents: Plan
    KKAA     RKAEP000     740          80          Sales Document Line Items Res.Anal.
    KKCA     RKAEP000     630          80          Cost Objects: Variance Line Items
    KKCP     RKAEP000     230          80          Cost Object Line Items - Plan
    KKCS     RKAEP000     130          80          Cost Objects: Line Items - Actual
    KKFB     RKAEP000     650          80          RS Header: Line Items Variance
    KOB1     RKAEP000     110          80          Orders: Actual Line Items
    KOB2     RKAEP000     310          80          Orders: Commitment Line Items
    KOB3     RKAEP000     610          80          Orders: Variance Line Items
    KOB4     RKAEP000     910          80          Orders: Budget Line Items
    KOB5     RKAEP000     510          80          Orders: Maint. Line Item Settlement
    KOB6     RKAEP000     510          80          Orders: Settlement Line Items
    KOB7     RKAEP000     510          80          Orders: Line Item Settlement Retirem
    KOB8     RKAEP000     710          80          Orders: WIP/Results Anal. Line Items
    KOBP     RKAEP000     210          80          Orders: Plan Line Items
    KRMI     RKAEP000     150          80          Run Sched. Header: Line Items Actual
    KSB1     RKAEP000     100          80          Cost Centers: Actual Line Items
    KSB2     RKAEP000     300          80          Cost Centers: Commitment Line Items
    KSB5     RKAEP000     400          80          Controlling Documents: Actual
    KSBP     RKAEP000     200          80          Cost Centers: Plan Line Items
    KVBI     RKAEP000     140          80          Sales Documents: Line Items Actual
    KVBO     RKAEP000     320          80          Sales Documents: Commit. Line Items
    Thank You,
    Ganesh

  • Function Module not released yet. Has anybody used them in their programs?

    Hi
    I am trying to use the barcode functionality during a goods movement 101 (using MIGO). As we donu2019t have any control of SAPu2019s barcode functionality thru configuration in MIGO I have developed a custom popup and I am calling this in a BADI implementation MB_MIGO_BADI. Once the user enters the barcode then I call Function module ARCHIV_BARCODE_GLOBAL to save the barcode to the standard tables.
    This Function module is not released to the customers and it was last changed on 11/12/2004.
    My question is should I be using this Function module in my BADI implementation even though it is not released (does not have a release date) ?. Has anyone of have used a unreleased Function module in your programs?.
    Additionally I need this info
    I am using ECC 5.0. If anyone of you is using ECC 6.0 or higher can you please check and let me know if this FM ARCHIV_BARCODE_GLOBAL is released or not or when was it last changed.
    Please advice me at you earlist
    Thanks of your time
    SHraj

    Hi,
    We are not using the above FM. But I can give some Info from ECC 6.0.
    In ECC 6.0 the above FM is realeased for customers.
    Last changed on:28.12.2004 18:28:16.
    You can use the same code in ur Z function module.
    Thanks and Regards

  • When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. pleas

    When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. please re install of repair the application and try again. I have done this and it's still not working                  

    anomaly jade,
    You only need to use the serial number during installation.
    Have you, at least seemingly, been able to install, and then you are unable to start up?
    If that is the case, you could try to reinstall using the full three step way:
    Uninstall, run the Cleaner Tool, and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • OIM 11g using too much memory and not releasing it when shutting down

    Hello,
    we have a problem with OIM 11g using too much memory (about 5gb) and it's not releasing it at shutdown (4gb still used).
    We are using a VM with RedHat Linux 5.6. Originally we had 4gb RAM + 2gb swap file. We installed Admin Server, OAM, OIM and SOA on that machine but quickly realised we couldn't run all 4 programs at once in 6gb. AdminServer could run with 2 other products, but it was a tight fit in memory.
    So we increased the RAM to 8gb (still 2gb swap file). But then our problem occured : I start the Admin Server (2.7gb total memory used), then OAM (4.6gb total memory used) and then OIM. After it started the server is now using 9.6gb of memory (~300mb of free memory) ! The problem gets even better : after I shut down everything (OIM, OAM, admin server) the "top" command show that there is still 4gb of memory used even tho nothing else is running on the server ! There is absolutely no other process (other than root stuff) running and no other users connected to the machine. After a reboot, it shows 400mb of memory used. I tried restarting the programs and it did the same thing.
    Our intuition is that there might be a memory leak or some bug in OIM that might use up almost all the free memory and it's not releasing it upon shutdown. It might have been there before we increased the memory but have not noticed it since memory was already tight.
    Anyone encountered the same problem ? Any idea ? Any suggestion to narrow down the problem ?
    Thank you

    You can adjust the memory settings for WLS by editing the setSOADomainEnv.sh file that can be found in your /middleware/user_projects/domains/<domain>/bin/ folder. There is an argument called PORT_MEM_ARGS which is used to set your Java memory arguments. This way you can decrease/increase the amount of memory used by each managed server.
    I usually type "ps -ef | grep oracle" to see what processes are running by the oracle user. This way the output doesn't get cluttered with root processes.
    Sunny Tsang

  • Labview: resource not found error code 24 when building executable using 8.20 and dsc module

    I am trying to build an executable and I keep getting and error and cannot seem to figure out what is wring.  The whole error is "LabVIEW: resource not found.  An error occured loading "interface 3.vi"  Labview load error code 24:  this vi cannot be loaded because it is broken and has no block diagram."
    I am using LV 8.20 and DSC 8.2.  I am trying to create an executable that has the web server running for using remote panels, i have netowrk published shared variables, connecting to a fieldpoint unit, and I am using the NI system tray icon vis to load the program to the system tray.
    I have my shared variable library added as a support file, as well as the lvdsc.ini, and the tray icon files.  I have sleected "Enable Enhacned DSC run time support" in the app builder, did not remove any type def,etc.
    I cannot get the .exe to run on my development machine or another machine, I get the same error.  I tried creating an installer that installed the 8.2 runtime, dsc,fieldpoint, variable engine and manager and MAX.
    I could not find anything in the help files on the dsc, maybe someone else has some hints.  thanks
    Kenny

    Hi Kenny,
    I hope you are doing well today! What is interface 3.vi? Is it possible for you to post your project over here? Also, I would recommend creating a simple DSC application; and would like you to build it. Do you still get errors?
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Shellext dlls are not preserved across upgrades, but the programs that installed them are

    classic 32 & 64 bit shell extension dlls (%windows%\system32\shellext resp %windows%\syswow64\shellext) are not preserved across system upgrades, yet the programs that installed the extensions are. copying them manually from windows.old is a workaround,
    but probably not viable for normal users...
    very simple, basic tool that is affected by the problem: http://code.kliu.org/hashcheck/
    the problem has been around since the first windows 10 build, and is still present in 10061

    Hi heldchen,
    Thanks for posting and sharing this in forums.
    For the current situation, I am not able to test this out. I will setup a test, and once I have the same symptom, I will submit feedbacks from my side.
    Besides, fi any further suggestions or problems, please take use of feedback tool.
    Regards
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for