Help, about data synchronization between C++ and PHP API!

I use Berkeley DB XML as my Server's database, the client access the database via http by C++ API. I don't close the XmlManager and XmlContainer after read and write the database for better performance. However, I provide another way to manipulate the database via web by PHP. After I updated the data by PHP, I found that I couldn't catch the update.
If I close the XmlManager and XmlContainer after read and write the database every time, the problem disappeared. But I can't do that for performance.
How can I solve this problem? Thanks!

First of all, thank you for your attention.
I don't share the same environment for the two processes, but I seted the same configure flags on the environment. The flags as follows:
DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
The C++ code as follows:
//C++ code
UINT32 envFlags = DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
INT32 lRet = 0;
string ctnName = "rls_services.bdbxml";
string docName = "index.xml";
CHAR acXQuery[256] = {0};
CHAR acXmlDoc[] = "<test>C++ test</test>";
//from      
DbEnv *pDbEnv  = new DbEnv(0);
XmlManager *pxmlMgr = NULL;
pDbEnv->open("/usr/local/xdms", envFlags, 0);
pxmlMgr = new XmlManager(pDbEnv, DBXML_ADOPT_DBENV);
lRet = pxmlMgr->existsContainer(ctnName);
if(0 == lRet)
     pxmlMgr->createContainer(ctnName);     
XmlContainer xmlCtn = pxmlMgr->openContainer(ctnName);
//to
// the code between 'from' and 'to' is a seperate function
XmlQueryContext xmlQC = pxmlMgr->createQueryContext();
XmlUpdateContext xmlUC = pxmlMgr->createUpdateContext();
sprintf(acXQuery, "doc(\"%s/%s\")", ctnName, docName);
XmlQueryExpression xmlQE = pxmlMgr->prepare(acXQuery, xmlQC);
XmlResults xmlResult = xmlQE.execute(xmlQC);
XmlDocument xmlDoc;
if (xmlResult.hasNext())
xmlDoc = xmlCtn.getDocument(docName);
xmlDoc.setContent(acXmlDoc);
xmlCtn.updateDocument(xmlDoc, xmlUC);
else
xmlDoc = pxmlMgr->createDocument();
xmlDoc.setName(docName);
xmlDoc.setContent(acXmlDoc);
xmlCtn.putDocument(xmlDoc, xmlUC);
// I don't close the Container and Manager for performance
The PHP code as follow:
<php?
$DB_DIR = "/usr/local/xdms";
$env = new Db4Env();
$enFlags = DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
$env->open("/usr/local/xdms", $enFlags, 0);
$xmlManager = new XmlManager($env, 0);
$ctnName = 'rls_services.bdbxml';
$docName = 'index.xml';
$docContent = '<test>PHP test</test>';
if (!$xmlManager->existsContainer($ctnName))
     return ;
$xmlCtn = $xmlManager->openContainer($ctnName);
$xmlQC = $xmlManager->createQueryContext();
$xmlUC = $xmlManager->createUpdateContext();
$acXQuery = "doc('".$ctnName.'/'.$docName."')";
$xmlQE = $xmlManager->prepare($acXQuery, $xmlQC);
$xmlResult = $xmlQE->execute($xmlQC);
if ($xmlResult->hasNext())
     $xmlDoc = $xmlCtn->getDocument($docName);
     $xmlDoc->setContent($docContent);
     $xmlCtn->updateDocument($xmlDoc, $xmlUC);
else
     $xmlDoc = $xmlManager->createDocument();
     $xmlDoc->setName($docName);
     $xmlDoc->setContent($docContent);
     $xmlCtn->putDocument($xmlDoc, $xmlUC);
unset($xmlDoc);
unset($xmlCtn);
?>
The code between 'from' and 'to' excute only one time when server start.
After the server started, I write data by PHP. I can read out the data that
writed by PHP just now, but I can't read out the data by C++ because I don't
close the XmlContainer and XmlManager.
After I restarted the server, I can readout the data by C++. But I can't
open and close database for each request for performance as a server.
what should I do ? Thank you!
Whether I express my question clearly or not?

Similar Messages

  • Data Synchronization between Planning and HPCM

    Hello,
    How it is possible to synchronize the Data between HPCM and Planning?
    I have 12 Dimensions in HPCM and only 8 Dimensions in Planning.
    8 Dimensions in HPCM are like Planning dimensions + 2 Standard HPCM dimensions + 2 staging dimensions.
    I want to move the Data from HPCM to Planning (Both 11.1.1.3)
    Many thanks in advance,
    Whitebaer

    Are you re-initialising your Source System after adding new members to EBS?
    Regards,
    Gavin

  • Data synchronization between ERP and BI

    Hi Experts,
    We have done a client copy from BI production to BI test and later after 2 weeks we have done client copy of ERP production source system to ERP test source system.
    As we have 2 weeks of gap inbetween these two client copies and ERP being the later, we have 2 weeks of more data in ERP test system which is not available in BI test.
    Now, My requirement is to transfer these two weeks of data from ERP test source system to BI test system.
    I hope some of you would have faced the similar requirement and any help on this seriously appreciated.
    regards,
    Magaan.

    Hi vamsi nagaraju
    it depends on wich version of ECC you are using, if you are using ECC 6.0 or ECC 5.0 all records are in table FAGLFLEXT but if you are using R/3 4.7, 4.6 etc, all records are in ECMCT for consolidation purposes.
    Try to run T-code F.01 for balance sheet in both versions.
    which validations do you want?
    regards!!

  • Array data between Flash and PHP

    As the title suggests, I'm trying to find a good way of
    getting an ActionScript/Flash dynamic array into PHP, so I can
    serialize it and store it in a DB, then simply give back that same
    array when it's called. Are there any popular techniques? The array
    will always be a different size, containing different values -
    which is why I'd like to keep the array in tact, to minimise the
    amount of parameter transfers. If there's no good solution, I
    suppose I could pass in parameters and read them in, create an
    array and serialize that... but I'd much rather find a way of
    having my flasher serialize his own array and pass me the
    byte-code. Is this possible?
    PHP doesn't need to read the contents of the array, simply
    store it in a DB, so if there's some kind of flash method for
    serializing an array into bytecode that it can unserialize and read
    back later, that would be awesome.
    Thanks. =]
    [edit]
    I found this:
    http://sourceforge.net/projects/serializerclass/
    a serializer class. Is this the best method?

    Sorry, I should have explained, we already use XML for data
    transfers (though I personally find JSON much nicer with less
    overhead). So, in this project, we use XML for data transfer
    between flash and PHP/Database. The reason I wanted this
    functionality, is because the flash array, in this one case, will
    be completely dynamic and the PHP doesn't need to know the contents
    of the array at all. In fact, in this instance, PHP is just the
    mechanism used for storing the data. Becuase of the nature of the
    data, I wanted to serialize the flash array, store it in the
    database as Bytecode, then when the flash needs that information
    again, I can pass back the same bytecode, which can then be
    unserialized back into the original array.
    I think I've found the solution, the one I linked in the
    original post. I should know if it's as effective as I want it to
    be in the next couple of days when my flasher gives it a try. =]
    Thanks for the responses. If anyone has any other ideas,
    please throw them in here.

  • Data sync between oracle and sql server

    Greetings Everyone,
    Your expert views are highly appreciable regarding the following.
    We at work are evaluation different solutions to achieve data synchronization between oracle and sql server data bases. Data sync i mentioned here is for live applications. We are runnign oracle EBS 11i with custom applications and intending to implement a custom software based on .NET and SQL Server. Now the whole research is to see updates and data changes whenever happens between these systems.
    I googled and found Oracle Golden Gate, Microsoft SSIS, Wisdom Force from Informatica....
    If you can pour in more knowledge then it's great.
    Thank You.

    Most of the work involved has to be done through scripts and there is no effective GUI to implement OGG.However using commands is not vey togh and they are very intutive.
    These are the steps, from a high level:
    1.Get the appropriate GG Software for your source and target OS.
    2.Install GG on source and target systems.
    3.Create Manager and extract processes on source system
    4.Create Manager and replicat processes on target system
    5.Start these processes.
    First try to achieve uni-directional replication. Then Bi-directional is easy.I have implemented bi-directional active active replication using Oracle DBs as source and target. Refer to Oracle installation and admin guides for more details.
    Here is a good article that may be handy in your case.
    http://www.oracle.com/technetwork/articles/datawarehouse/oracle-sqlserver-goldengate-460262.html
    Edited by: satrap on Nov 30, 2012 8:33 AM

  • Passing values between jsp and php

    hi there, is it possible to pass values between jsp and
    php? i really need to find out the way if there is
    any. thanks in advance
    -azali-

    Yes, there are a few ways to do this.
    1) Think about using Cookies.
    2) Maybe use a Redirect passing the values in the Query string.
    3) Retain the data in a repository in the back end.
    4) Using Hidden fields within your pages.
    I am sure you can use these Idea's for a base to develop other methods on how to pass values back and forth from JSP -> PHP and vice versa.
    -Richard Burton

  • Secure the file/data transfer between XI and any third-party system

    Hi All,,
    I would like to use to "secure" SSH on OS Level the file/data transfer between XI and any third-party system Run OS Command before processing and OS command After processing. right now my XI server installed on iSeries OS.
    with ISeries we can't call the Unix commands hope we need to go for AS400 (CL) Programming. If we created the AS400 programm how i can call that in XI.
    If any one have idea pls let me know weather it will work or not.
    Thanks in adavance.
    Venkat

    Hi,
    Thanks for your reply.
    I have red some blogs like /people/krishna.moorthyp/blog/2007/07/31/sftp-vs-ftps-in-sap-pi to call the Unix Shell script in XI.
    But as i know in iSeries OS we can write the shell script we need to go for AS400 programe. If we go with AS400 how we need to call that programe and it will work or not i am not sure there i need some help please.
    Thanks,
    Venkat

  • I need help syncing my contacts between Outlook and iPhone using iTunes. I followed the steps given and ended up with just email addresses showing in my contacts even though I have phone numbers and snail mail in my Outlook Contacts. Using  Windows 7

    I need help syncing my contacts between Outlook and iPhone using iTunes. I used the knowldge document and set it up to transfer my Outlook contacts to the iphone using itunes.
    In contacts on the iphone I only see the email addresses.
    Yet in Outlook I have email, snail mail and phone numbers.
    I followed the knowledge document from iphone.
    I did it once, didn't work so deleted all the contacts from the phone and tried again. Same result. I have a PC using Windows 7 64 bit.

    You can't access an Exchange account via ActiveSync with the Address Book and iCal on your Mac.
    You can access a MM account with Outlook on your PC at work and keep your MM email account server stored mailboxes synced between your PC at work, your iPhone, and the MM "cloud". Not sure about syncing MM contact info and calendar events with Outlook at the same time with an Exchange account.
    This will not provide for syncing your Exchange account contact info and calendar events with the Addresss Book and iCal on your Mac because the accounts are separate.
    You can access an Exchange account and a MM account at the same time with the iPhone's mail client, and sync contact info and calendar events over the air with both accounts at the same time. You can view combined contact info or separately for each account, and the same for calendar events.

  • Data mismatch between 10g and 11g.

    Hi
    We recently upgraded OBIEE to 11.1.1.6.0 from 10.1.3.4.0. While testing we found data mismatch between 10g and 11g in-case of few reports which are including a front end calculated column with division included in it, say for example ("- Paycheck"."Earnings" / COUNT(DISTINCT "- Pay"."Check Date")) / 25.
    The data is matching for the below scenarios.
    1) When the column is removed from both 10g and 11g.
    2) When the aggregation rule is set to either "Sum or Count" in both 10g and 11g.
    It would be very helpful and greatly appreciated if any workaround/pointers to solve this issue is provided.
    Thanks

    jfedynic wrote:
    The 10g and 11.1.0.7 Databases are currently set to AL32UTF8.
    In each database there is a VARCHAR2 field used to store data, but not specifically AL32UTF8 data but encrypted data.
    Using the 10g Client to connect to either the 10g database or 11g database it works fine.
    Using the 11.1.0.7 Client to go against either the 10g or 11g database and it produces the error: ORA-29275: partial multibyte character
    What has changed?
    Was it considered a Bug in 10g because it allowed this behavior and now 11g is operating correctly?
    29275, 00000, "partial multibyte character"
    // *Cause:  The requested read operation could not complete because a partial
    //          multibyte character was found at the end of the input.
    // *Action: Ensure that the complete multibyte character is sent from the
    //          remote server and retry the operation. Or read the partial
    //          multibyte character as RAW.It appears to me a bug got fixed.

  • Data Replication Between Sqlserver and Oracle11g using materialized view.

    I have Sqlserver 2005 as my source and oracle11g as my target.I need to populate the target daily with change data from source.
    for that we have created a dblink between sqlserver and oracle and replicated that table as a Materialized view in Oracle.
    problem we are getting here is Fast refresh option is not available.each day it will pick full data from the source.
    is there any way to use Fast refresh in this scenario??
    Thanks in advance.
    Regards,
    Balaram.

    Pl do not post duplicates - Data Replication Between Sqlserver and Oracle11g using materialized view.

  • Data streaming between server and client does not complete

    Using an ad-hoc app, data streaming between server
    and client does not complete as it supposed to be.
    The process runs well in solaris 5.8, however under 5.9
    we have found the characters stream buffer length limitation
    is around 900 to 950 characters (by default we are using 3072
    characters).
    Example:
    - We are transfering HTML file, which will be displayed
    in the App client, with buffer=3072, the HTML only displayed / transfered
    as xxxxxxxx characters, but with buffer=900 the HTML is displayed properly,
    in this case, the only problem that we have is the file transfer will
    eventually longer than usual.
    - There is another case, where we have to transfer information (data) as stream
    to the client. A long data stream will not appear at all in the client.
    Any ideas why the change between 5.8 and 5.9 woudl cause problems?
    The current app-driver that we are using is compiled using Solaris 5.6,
    if possible we would like to have use of a later version, which is compiled using Solaris 5.9, do you think this will probably solve our problem?
    Thanks
    Paul

    Does this have anything to do with Java RMI? or with Java come to think of it?

  • Difference in event handling between Java and Java API

    could anyone list the differences between Java and java-API in event handling??
    thanks,
    cheers,
    Hiru

    the event handling mechanisms in java language
    features and API (java Application Programming
    Features)features .no library can work without a
    language and no language has event handling built in.
    I am trying to compare and contrast the event
    handling mechanisms in the language and library
    combinations such as java/ java API.
    all contributions are welcome!
    thanks
    cheersSorry, I'm still not getting it. I know what Java is, and I know what I think of when I hear API. (Application Programming Interface.) The API is the aggregation of all the classes and methods you can call in Java. If we agree on that, then the event handling mechanisms in Java and its API are one and the same.
    So what do you want to know?
    %

  • Password synchronization between OID and AD - 10.1.2

    Hi,
    I've some questions about the following issue:
    I've tried to setup the password synchronization between OID 10.1.2 and active directory, with the intent of exporting ldap users from OID to AD..
    Well, the bootstrap gone fine, but when I tried to activate the export of password in the activexp.map configuration file,
    I've obtained this:
    *Writer Thread - 0 - [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A0FC0, problem 5003  (WILL_NOT_PERFORM), data 0*
    for each entry I tried to export...
    I've opened a SR on metalink and I've received the following answer:
    _"  As shown by the synchronization profile, currently you have a mapping for the password from OID to AD._
      _userpassword: : :person:unicodepwd: :person:_ 
      _According to the documentation, password synchronization requires the directories to be configured for SSL mode:_
        _http://download-uk.oracle.com/docs/cd/B14099_12/idmanage.1012/b14085/odip_actdir003.htm#CHDEFIED_
    _18.3.2.8 Synchronizing Passwords_
      _You can synchronize Oracle Internet Directory passwords with Active Directory._
       _You can also make passwords stored in Microsoft Active Directory available in Oracle Internet Directory._  
       _Password synchronization is possible only when the directories run in SSL mode 2, that is, server-only authentication."_
    The SSL setup is the only way to achieve this, or there's another alternative?
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Yes. It needs to be in SSL.
    http://download-uk.oracle.com/docs/cd/B14099_12/idmanage.1012/b14085/odip_actdir003.htm#CHDCJHHB
    Some excerpts:
    Active Directory Connector uses SSL to secure the synchronization process. Whether or not you synchronize in the SSL mode depends on your deployment requirements. For example, synchronizing public data does not require SSL, but synchronizing sensitive information such as passwords does. To synchronize password changes between Oracle Internet Directory and Microsoft Active Directory, you must use SSL mode with server-only authentication, that is, SSL Mode 2.
    -shetty2k

  • User base Synchronization between SAP and MS Active Directory Server

    Dear all!
    I'm using Web AS 6.20 ABAP and MS Active Directory Server based on Win 2003 Server.
    i successfully implemented the synchronization of user data between SAP and the ADS.
    My question: Is there a way to customize the users on Active Directory Server in regard to their SAP authorization (roles auth. objects etc.)?
    Currently I don't have a clue how to do this.
    Regards,
    Christoph

    Have you searched on SDN for "Active Directory"? That turns up a number of results. I think your expectation might be backwards though, it's not how ADS exposes SAP specific data but how SAP uses ADS to store SAP specific data. My understanding (from quite some time ago so I am fuzzy on this) is that SAP can use ADS in much the same way it can use LDAP as an external user store.
    The Security Newsletter from November 04 [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/sap security newsletter november 2004.pdf] mentions that a webinar is hosted on SDN about this exact topic, unfortunately I was unable to find a direct link.
    Regards,
    Marc g

  • Method of Synchronization between XE and Enterprise (Offline)

    Hi,
    We have two DB servers hosted in two locations which has 10g XE and 10g Enterprise.
    These sites will be connected in dial-up lines only when needed to synchronize (from XE to Enterprise).
    Please can anyone tell me what is the best method we can do for synchronizing data in between these two servers in dial-up line.
    Thanks!
    Nilaksha.

    This is old info but the Workaround might help if such is the case.
    http://btsc.webapps.blackberry.com/btsc/viewdocument.do?externalId=KB32234&sliceId=2&docType=kc&noCo...

Maybe you are looking for

  • Manual Sync

    Hi, The manual sync and background sync are working for me, but when I login or logout, it does not work! any idea? -Popak

  • Itunes 9.02, Snow Leopard and iMac 24 - FREEZE UP!

    I have 4 mac machines in the home and this problem is only affecting the iMac 24. From reading multiple forums, I can safely say that I am not the only one. iTunes freezes sort of randomly during playback, store browsing, podcast etc... The only thin

  • Huge number of files in Leopard according to VirusBarrier X4

    Loaded a demo copy of VirusBarrier X4 with the idea of buying it and when I ran the scan, it produced a file count of over 1,170,000 before I stopped it! Prior scan produced a count of over 600,000. Obviously VirusBarrier X4 doesn't know how to count

  • After Yosemite, "Google Account: sign-in attempt blocked"

    Hi. Since I upgraded to Yosemite, now everyday I get this message in my email box. It happens exactly at the time I turn my computer on, doesn't matter if my personal one or the one I use at work. Is Yosemite doing something different with my Account

  • Mavericks download confusion

    I'm living in Baja Mexico and everytime i go to the app store it loads with spanish looking headings page and i'm afriad to use this one? Not sure it it will be ok or not. The ads are all in english on the page.