Concurrency with multiprocess application

Hi,
I have a serious problem here.I am supposed to design a multi process application in C++ that interacts with Berkeley DB. I have two binaries, one of the binary updates the database, while the other has to read it.The Db object is opened only once during the start up of the application for the binary that reads, So when I read it any time in the life cycle of the application, I expect to read the latest records.But it is not reading the latest records. I get only the records that were present during the db open operation.Both the binaries have different environment objects but pointing to the same directory and have different Db objects opening the same database file.
The documentation speaks only about concurrency in a multi threaded application , how about for multi process application?Can some one help me with the same
Nandish

Hi there,
Thank you for posting the processes skeleton (it had been better if you had posted the env and db flags). I will try to explain from both, CDS and TDS, point of view ( http://www.oracle.com/technology/documentation/berkeley-db/db/ref/intro/products.html )
First, you should not use DB_PRIVATE flag on your environment. If you are using it, the env may only be accessed by a single process, multithreaded or not.
DB_PRIVATE: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_open.html#DB_PRIVATE
If you want to share database/databases that change at all, you must first share the environment. Otherwise, the processes wouldn't all see the same pages in the mpool and in case that more than one wants to modify the database/database, they wouldn't block each other from concurrent modifications.
A database environment is a way to share resources among a set of databases, most importantly for your application, the database cache. An environment may be shared by any number of processes, as well as by any number of threads within those processes, but you can't share anonymous databases between processes since they are identifiable by their DB handle, which can't be copied between processes.
All processes sharing the environment must use registration. If registration is not uniformly used across all participating processes, then you can see inconsistent results in terms of your application's ability to recognize that recovery must be run.
DB_REGISTER: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_open.html#DB_REGISTER.
It is possible for an environment to include resources from other directories on the system, and applications often choose to distribute resources to other directories or disks for performance or other reasons. However, by default, the databases, shared regions (the locking, logging, memory pool, and transaction shared memory areas) and log files will be stored in a single directory hierarchy.
When region files are backed by system memory, DB creates a single file in the environment's home directory. This file contains information necessary to identify the system shared memory in use by the environment. By creating this file, DB enables multiple processes to share the environment.
Shared memory regions: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/env/region.html
Architecting Transactional Data Store applications: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/app.html
Bogdan Coman

Similar Messages

  • Concurrency with transactions

    Hi,
    My requirement tells that my program should maintain transactions and also it needs concurrent read and write on the same database object.With concurrency document "http://www.oracle.com/technology/documentation/berkeley-db/db/ref/cam/intro.html" clearly tells that transactions are not allowed with concurrency.What should be my approach for this requirement?
    Regards
    Nandish

    Hi Nandish,
    I think that you are saying about "It is an error to specify any of the other DB_ENV->open subsystem or recovery configuration flags, for example, DB_INIT_LOCK, DB_INIT_TXN, or DB_RECOVER." - this means that is an error to specify those flags when configuring the environment as Concurrent Data Store. You can see the differences between the Berkeley DB products in here: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/intro/products.html
    Also, you can see what a Transactional Data Store is about, in here: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/app.html
    Please also consider the other thread that you had opened: Concurrency with multiprocess application
    Thanks,
    Bogdan Coman

  • Documents rows cannot be closed concurrently with the other document modify

    Hello Experts !!!
    Now  i am using SAP BUSINESS ONE 2007 B PATCH LEVEL 19.
    problem is that previously i was using patch level 4.
    when i was using patch level 4 , i used to punch sales order.
    now when i upgraded to patch level 19 .SAP is not allowing to update the so which was punched in patch level 4.
    SCENARIO
    1.so is raised of 10 pcs in patch level 4.
    2.delivery was punched of 5 pcs.
    3.now sap upgraded to patch level 19.
    4.now m modifying that so.
    5.particular so which was of 10 pcs , m reducing that 10 pcs to 5 pcs.
    5.now that particular is closed .
    6. when i add remaining 5 pcs below that row and update.it is throwing me an error "Documents rows cannot be closed concurrently with the other document modifications you have made"
    PLEASE HELP EXPERTS
    Regards
    A S VAMSI KRISHNA

    Dear krishnavamsi,
    I would like to ask you to read these notes and check if they are relevant to your issue:
    1036601
    1131943
    1298236
    Also, I would like to know how did the customer add the document in the previous version, manually by application or by DI API, ADD ON or any customization?
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Unable to connect SQL server 2005 databse with JSF applications !

    Hello guys!
    Help me out to connect SQL server 2005 Databse with JSF applications using JDBC-ODBC bridge. I'm working with Netbeans 6.1 IDE.
    I tried for the basic applications but instead got this error:
    "unable to deploy jdbc drivers to the <project>domain/lib"
    Please help me out with working sample codes that connects MS SQL server 2005 DB with JSF!!
    Thank you guys!

    1) don't use the bridge driver
    2) don't do database access from JSF
    3) learn how to use your application server
    4) learn how to use your IDE

  • How do I access "Firefox is NOT compatible with this application. For best performance, please use Internet Explorer 5.0 and above...." web sites; when I try to download any alternate browser, then a warning that alternate is "imcompatable with your opera

    How do I access websites that warn: "Firefox is NOT compatible with this application. For best performance, please use Internet Explorer 5.0 and above...."? When I try to download any alternate browser, all I get is another warning that the alternate is "not compatible with your operating system." Is Firefox preventing this? The site listed below is a job application site. I've had this same problem with other job application sites also.
    == URL of affected sites ==
    https://storefront.kenexa.com/lithia/cc/Home.ss

    There should be a User Agent Switcher menu item under Tools, which gives you the browser names you can impersonate.
    The menu item name changes to the browser UA you are presently using.
    There is also a User Agent Switcher button, you can add it using View -> Toolbars -> Customize, and dragging the button to your toolbar.
    See http://chrispederick.com/work/user-agent-switcher/features/ and http://chrispederick.com/work/user-agent-switcher/help/
    You can just start trying IE versions (or the versions it says on the site) until it lets you in.

  • While send/receive email, I have received an error message "Sending of password d"? However with same login details, I am able to login with other application.

    While send/receive email, I have received an error message "Sending of password d"?
    However with same login details, I am able to login with other application.
    I have changed password still the issue remains as it is.

    https://support.mozilla.org/en-US/kb/cannot-send-messages

  • Open File With LabVIEW Application

    I have a LabVIEW application that can be used to analyze several data files at once.  I am wondering what the best way to right click on a file from Windows Explorer and open with the application.  I know you can use the command line property node to find what file was opened if the application is not running when you open the file, but from what I found, this does not work if the application is already running.  I have a work around in place by using my main application as an ActiveX server, and another application which reads the file name from the command line when the user right clicks and opens the file, passes the path to the main application, and shuts down so the process can be repeated.  Is anyone familiar with a way to do this without have two executables?

    This is not easy but you can find info there :
    - http://lavag.org/topic/10829-how-to-assign-file-extension-to-exe/
    - http://lavag.org/topic/4851-associating-my-exe-with-a-specific-file-extension-type/
    - http://labviewwiki.org/Associate_your_own_file_type_with_Windows_Explorer
    Hope this helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Everytime I open Safari on my MacBook Pro a pop-up window from my Finder menu, with the Applications highlighted on the left in the favorites column with the Resources folder highlighted comes up and locks my Safari page until I manually close the Resourc

    Everytime I open Safari on my MacBook Pro a pop-up window from my Finder menu, with the Applications highlighted on the left in the favorites column with the Resources folder highlighted comes up and locks my Safari page until I manually close the Resources window then I have to refresh the internet search address line at the top of Safari. Can someone tell me how to stop this. It started after a software upgrade. It didn’t do that before. Thank you.

    A few thoughts for diagnosis/testing purposes:
    Have you recently run the disk utility and repaired HD and permissions? If not do so.
    Boot into the Safe mode - hold down shift key on boot - and see if the problems are still there. Some functions won't work but see if anything odd happens.
    Check your startup items. Get rid of them temporarily.
    Create a new user account and see if the problems occur with the new account.
    Lastly, be sure your backup is up-to-date.

  • How to use JavaMail 1.4 with Oracle Application Server 10g (9.0.4.0.0)

    Hi all,
    I'd like to know if it's possible and how to use JavaMail 1.4 with Oracle Application Server 10g (9.0.4.0.0), Windows version.
    With the following code, I can see that the mail.jar used by the server is the one included in the jdk installation :
    // I'm testing InternetAddress.class because I want to use commons-email-1.2.jar that requires mail.jar 1.4 (or higher) and activation.jar 1.1 (or higher)
    // and I know that inside the commons-email-1.2.jar file, I need to call the InternetAddress.validate() method that throws a java.lang.NoSuchMethodError: javax.mail.internet.InternetAddress.validate()V if it is used with mail.jar 1.2.
    Class cls = javax.mail.internet.InternetAddress.class;
    java.security.ProtectionDomain pDomain = cls.getProtectionDomain();
    java.security.CodeSource cSource = pDomain.getCodeSource();
    java.net.URL location = cSource.getLocation();
    System.out.println(location.toString());
    This code returns : file:/C:/oracle/app/jdk/jre/lib/ext/mail.jar and this mail.jar file has an implementation version number: 1.2
    - I've tried to include my own mail.jar (1.4.2) and activation.jar (1.1.1) files in the war file that I deploy, but it doesn't work (the server still uses the same mail.jar 1.2)
    - I've tried to put the mail.jar (1.4.2) and activation.jar (1.1.1) files in the applib directory of my OC4J instance, but it doesn't work (the server still uses the same mail.jar 1.2)
    - I know that a patch exists : I've read the following document: How to Make Libraries such as mail.jar and activation.jar Swappable ? [ID 552432.1]
    This article talks about the Patch 6514136, but this patch only applies to : Oracle Containers for J2EE - Version: 10.1.3.3.0
    Can you please help me ?
    Thanks in advance for your answers,
    Laurent

    I strongly suggest to upgrade to AS 10.1.3 to get this.
    Think of future support of AS 9.0.4. You will get not critical patch updates anymore.
    --olaf                                                                                                                                                                                                                                                                                                               

  • How to use SSO with Forms application

    Can somebody explain, how can we configure the SSO with Forms application.
    I have two application server instances. One for infrastructre and Other for application.
    Thanks

    Have a look at http://www.oracle.com/technology/products/forms/pdf/10g/frm10gsso.pdf and http://download-uk.oracle.com/docs/cd/B14099_19/web.1012/b14032/sso.htm#i1006721

  • How to configure Oracle 10g Advanced Security to use SSL concurrently with

    How to configure Oracle 10g Advanced Security to use SSL concurrently with database User names and passwords
    In Oracle Advanced Security Documentation it is mentioned that i can use SSL concurrently with DB user names and passwords. But when i configure the client certificate on the client my DB connection is getting authenticated using the certificate, which out passing user id or password.
    We want to connect to Oracle DB over SSL channel so that the data packets are not in clear text. Also we want the user to make a connection using user id and password.
    Basically we want SSL with out authentication.
    Need your expert advice

    Read the documentation (I have given following links assuming you are running a 32 bit architecture)
    Server installations:
    http://www.oracle.com/pls/db102/to_toc?pathname=install.102%2Fb14316%2Ftoc.htm&remark=portal+%28Books%29
    Client installations:
    http://www.oracle.com/pls/db102/to_toc?pathname=install.102%2Fb14312%2Ftoc.htm&remark=portal+%28Books%29
    You can find the required books (if not using 32 bit architecture) from
    http://www.oracle.com/pls/db102/portal.portal_db?selected=3

  • Can i use Airplay with other applications different to iTunes on my Mac Pro?

    Hi,
    I bought a Mac Pro 13' Retina Display two weeks ago and today i bought a Bose SoundTouch 20 and i connected both to my home network by ethernet cord. when i try to use applications like iTunes to send the sound of a song from mac to bose it work perfect, but when i try to do the same with spottily (i downloaded the app for my mac) simply doesn't work and don't know why. Another issue is that either can't send the sound of the movies and videos from mac to bose (i already try this using this configuration: send by airplay the movie to apple tv and from apple tv send the sound to bose, all work perfect because all was connected with ethernet cord).
    So the question is, Anyone know why the Airplay function only work with iTunes and with other applications simply doesn't?

    AirPlay only works with iTunes for Mac OS, iOS devices, and Apple TV.
    Not third party (non Apple) apps such as Spotify
    If the Bose Sound Touch supports Bluetooth, you may be able to stream music to the Mac or Apple TV. That's for sound, not video.

  • MathScript Nugget #19: Sharing Data With Other Applications

    In MathScript Nugget #18, we looked at ways to transfer data between MathSript and the rest of LabVIEW. In today's nugget, we'll see some of the different ways that MathScript can share data with programs besides LabVIEW.
    The most common way to share data between programs is by reading and writing files. MathScript supports several file formats that are recognized by other programs. The ones we'll touch on in this nugget are MLV, MAT, CSV, TXT, TDM(S) and XLS.
    The easiest way to bring data into MathScript is with the 'load' function. The help topic for this function does a great job of explaining it. The load function will bring in a group of variables that have been saved to a file earlier. The most common formats that load supports are:
    MLV files created with MathScript save function
    MAT files created with  version 6.0 or earlier of The MathWorks, Inc. MATLAB® software
    TDM and TDMS binary measurement files created in LabVIEW or DIAdem
    The load and save functions are great for storing off a group of variables to be used again in a future session of MathScript. You can do the same thing using the Operate>>Load Data... and Operate>>Save Data... menu items in the MathScript Window. These support the same file formats as load and save.
    The best formats to use if you want to share data with other applications are TXT, CSV, and XLS. MathScript has special funcitons to read and write each of these formats. The functions, such as fread_csv and fwrite_xls, are all members of the support class.
    The last way to read and write data files with MathScript is to use a custom file format. MathScript supports common file operations like fread and fwrite. You can use these functions to create or import files of any binary or textual format.
    There's one last way to move data out of MathScript without using files. You can copy data from the MathScript Window or MathScript Probe as tab-delimited text to your OS clipboard. You can then paste this text to a text editor or spreadsheet program.
    Hopefully now you have an idea of the many ways to move data into and out of MathScript.
    MATLAB® is a registered trademark of The MathWorks, Inc.
    jattas
    LabVIEW MathScript R&D
    ps Check out more MathScript Nuggets!

    TDM and TDMS are also excellent file formats to share your data with other applications. National Instrumenst offers free libraries and add-ins to access TDM and TDMS files with e.g. Excel, OpenOffice Calc or The MathWorks, Inc. MATLAB® software. Have a look at this page to 
    Find Resources for Reading and Writing TDMS Files in Third-Party Products

  • How to sync two IPhone with one PC , but with different applications

    How to sync two IPhone with one PC , but with different applications ?
    We have two IPhones , but one PC , we want to sync separately , is that possible ?

    Absolutely, connect each phone, select what content you want on each phone, then hit the sync button. iTunes will keep everything straight, by device, upon subsequent syncs, including separate backups.

  • Using a variable with "tell application"

    I'd like to use a variable (app_name) with "tell application" in the following function:
    on getAdobeDoc(app_name)
    tell application app_name
    tell current document
    return (name as Unicode text)
    end tell
    end tell
    end getAdobeDoc
    but I'm getting the following error in Script Editor
    "Expected end of line but found class name." with the word "document" highlighted.
    Are you allowed to use variables in "tell application"? All Adobe CS apps seem to use the same format to get the document name so I'd like to use one function to get them.

    If the application might have a different name on the target machine (for example, if it has a version number added), you can use an application's bundle identifier (or creator code) to set the variable, in which case the using terms from statement tells AppleScript the application (on your machine) to get the dictionary terms from. If the application you are using terms from has a dictionary identical to your variable, everything should work the same. The following example uses a variable (called, appropriately enough, TexttEdit) for the TextEdit application:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder" to set TextEdit to the name of application file id "com.apple.TextEdit"
    tell application TextEdit
    using terms from application "TextEdit"
    launch
    make new document with properties {text:"This is a test"}
    end using terms from
    end tell
    </pre>

Maybe you are looking for