BDB XML - C API

Hello guys!
Is there any pure C API for Berkeley DB XML? The deal is that I have a C code which works with BDB and I want to use BDB and Berkeley DB XML together.
Or maybe there are other solutions?
Thanks in advance!

I was afraid you'd say that. But all is not lost. You can construct XmlManager objects from DbEnv (C++) objects that can be created from DB_ENV. Ditto for DB_TXN -> XmlTransaction (via DbTxn).
There are methods in the DB C++ API to construct corresponding C++ objects for DB_ENV and DB_TXN. They are;
DbEnv * get_DbEnv(DB_ENV *);
DbTxn * get_DbTxn(DB_TXN *);
They are static methods in their respective classes, e.g.:
DbEnv *cppEnv = DbEnv::get_DbEnv(c_env);
DbEnv * can be passed to an XmlManager constructor and DbTxn * can be passed to XmlManager.createTransaction() to share the txn. In this case be careful of who commits the transaction and when the XmlTransaction object goes out of scope. If an XmlTransaction object goes out of scope it will implicitly abort the transaction even if it came from DB in the first place (this semantic could be argued but that's the way it is).
That means you can't let that happen until your C code is done with the transaction.
There is also a memory management problem with the DbEnv object that stems from the fact that the DbEnv C++ object will think that it "owns" the underlying C memory and in your case they don't. It means that if you delete() the returned DbEnv your DB_ENV handle will also be closed. This is a known issue in DB and one I've been trying to deal with for a while. You could always hack the DB source to avoid this but I don't recommend that.
This leak of DbEnv wrappers is not a big deal because you only will create XmlManager one time and use it so the leak of the C++ wrapper is a one-time event.
In the case of DbTxn you can actually delete the wrapper and it won't touch the underlying DB_TXN because it will be addressed by commit() or abort() calls. You can commit or abort via C++ if you like but you need to be sure to not touch the origina DB_TXN in that case.
Does all this make sense?
Regards,
George

Similar Messages

  • Bdb xml & python api

    I've been experiencing problems trying to build the python api library against python 2.5 on a PC running Redhat Entrprise Linux 4 using dbxml-2.3.10.
    If I run the following against python 2.3 I get no problems, and files _dbxml.so + dbxml.pyc are correctly created in /usr/lib/python2.3/site-packages. Output being as follows:
    [root@eld102 python]# /usr/bin/python2.3 /data/local/itjw/dbxml-2.3.10/dbxml/src/python/setup.py build
    running build
    running build_py
    running build_ext
    building '_dbxml' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m32 -march=i386
    -mtune=pentium4 -D_GNU_SOURCE -fPIC -fPIC -I../../include -
    I/usr/local/BerkeleyDB.4.5/include -I/usr/include/python2.3 -c
    dbxml_python_wrap.cpp -o build/temp.linux-i686-2.3/dbxml_python_wrap.o
    c++ -pthread -shared build/temp.linux-i686-2.3/dbxml_python_wrap.o -
    L../../build_unix/.libs -L/usr/local/BerkeleyDB.4.5/lib -
    L/usr/local/dbxml-2.3.10/lib -L/usr/local/dbxml-2.3.10/lib -Wl,-
    R../../build_unix/.libs -Wl,-R/usr/local/BerkeleyDB.4.5/lib -Wl,-
    R/usr/local/dbxml-2.3.10/lib -Wl,-R/usr/local/dbxml-2.3.10/lib -ldbxml-2
    -ldb_cxx-4 -lxqilla -lxerces-c -o build/lib.linux-i686-2.3/_dbxml.so
    Initially when I ran again python 2.5 I got the following:
    [root@eld102 python]# /usr/local/python2.5/bin/python /data/local/itjw/dbxml-2.3.10/dbxml/src/python/setup.py build
    running build
    running build_py
    running build_ext
    building '_dbxml' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
    prototypes -fPIC -I../../include -I/usr/local/BerkeleyDB.4.5/include -
    I/usr/local/python2.5/include/python2.5 -c dbxml_python_wrap.cpp -o
    build/temp.linux-i686-2.5/dbxml_python_wrap.o
    cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
    Ada/C/ObjC but not for C++
    dbxml_python_wrap.cpp: In function `int SWIG_Python_ConvertFunctionPtr
    (PyObject*, void**, swig_type_info*)':
    dbxml_python_wrap.cpp:2058: error: invalid conversion from `const char*'
    to `char*'
    dbxml_python_wrap.cpp: In function `void SWIG_Python_FixMethods
    (PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)':
    dbxml_python_wrap.cpp:36695: error: invalid conversion from `const
    char*' to `char*'
    error: command 'gcc' failed with exit status 1
    However, I have seen
    Python API build problem and have gotten around this error, but now when I rerun the command, it gets nowhere and doesn't give any errors.
    [root@eld102 python]# /usr/local/python2.5/bin/python /data/local/itjw/dbxml-2.3.10/dbxml/src/python/setup.py build
    running build
    running build_py
    running build_ext
    I have tried using the keyword --withBerkeleydb=/usr/local/BerkeleyDB.4.5 but this makes not difference as this is already picked up I believe.
    Where am I going wrong here such that files _dbxml.so + dbxml.pyc are not created for python 2.5?
    I'm not familiar with python or dbxml so a reply in layman's terms would be appreciated.

    Thanks for your help, George. It's easy when you know how.
    Output from both builds is now very similar:
    from Python 2.3:
    [root@eld102 python]# /usr/bin/python2.3 /data/local/itjw/dbxml-2.3.10/dbxml/src/python/setup.py build
    running build
    running build_py
    creating build/lib.linux-i686-2.3
    copying dbxml.py -> build/lib.linux-i686-2.3
    running build_ext
    building '_dbxml' extension
    creating build/temp.linux-i686-2.3
    gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -fPIC -fPIC -I../../include -I/usr/local/BerkeleyDB.4.5/include -I/usr/include/python2.3 -c dbxml_python_wrap.cpp -o build/temp.linux-i686-2.3/dbxml_python_wrap.o
    c++ -pthread -shared build/temp.linux-i686-2.3/dbxml_python_wrap.o -L../../build_unix/.libs -L/usr/local/BerkeleyDB.4.5/lib -L/usr/local/dbxml-2.3.10/lib -L/usr/local/dbxml-2.3.10/lib -Wl,-R../../build_unix/.libs -Wl,-R/usr/local/BerkeleyDB.4.5/lib -Wl,-R/usr/local/dbxml-2.3.10/lib -Wl,-R/usr/local/dbxml-2.3.10/lib -ldbxml-2 -ldb_cxx-4 -lxqilla -lxerces-c -o build/lib.linux-i686-2.3/_dbxml.so
    from Python 2.5:
    [root@eld102 python]# /usr/local/python2.5/bin/python /data/local/itjw/dbxml-2.3.10/dbxml/src/python/setup.py build
    running build
    running build_py
    creating build
    creating build/lib.linux-i686-2.5
    copying dbxml.py -> build/lib.linux-i686-2.5
    running build_ext
    building '_dbxml' extension
    creating build/temp.linux-i686-2.5
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../../include -I/usr/local/BerkeleyDB.4.5/include -I/usr/local/python2.5/include/python2.5 -c dbxml_python_wrap.cpp -o build/temp.linux-i686-2.5/dbxml_python_wrap.o
    cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
    g++ -pthread -shared build/temp.linux-i686-2.5/dbxml_python_wrap.o -L../../build_unix/.libs -L/usr/local/BerkeleyDB.4.5/lib -L/usr/local/dbxml-2.3.10/lib -L/usr/local/dbxml-2.3.10/lib -Wl,-R../../build_unix/.libs -Wl,-R/usr/local/BerkeleyDB.4.5/lib -Wl,-R/usr/local/dbxml-2.3.10/lib -Wl,-R/usr/local/dbxml-2.3.10/lib -ldbxml-2 -ldb_cxx-4 -lxqilla -lxerces-c -o build/lib.linux-i686-2.5/_dbxml.so
    The contents of the build subdirectory of /data/local/itjw/dbxml-2.3.10/dbxml/src/python contains:
    lib.linux-i686-2.3:
    total 2320
    -rwxr-xr-x 1 root root 2322571 Jul 13 09:54 _dbxml.so
    -rw-r--r-- 1 root root 42998 Nov 17 2006 dbxml.py
    lib.linux-i686-2.5:
    total 3536
    -rwxr-xr-x 1 root root 3568227 Jul 13 09:41 _dbxml.so
    -rw-r--r-- 1 root root 42998 Nov 17 2006 dbxml.py
    temp.linux-i686-2.3:
    total 3672
    -rw-r--r-- 1 root root 3755480 Jul 13 09:54 dbxml_python_wrap.o
    temp.linux-i686-2.5:
    total 5680
    -rw-r--r-- 1 root root 5802548 Jul 13 09:41 dbxml_python_wrap.o
    I think the bit about creation of _dbxml.so + dbxml.pyc at 2.3 and not 2.5 was probably a red herring; when I deleted these files and re-ran the 2.3 build they were not recreated in /usr/lib/python2.3.
    However, can you confirm that the build has done what it should, and if so, are files from the build directory copied ( do they need to be copied elsewhere) in order for the python api library to work correctly? Perhaps I have missed a keyword in the build?
    Jonathan

  • Use BDB XML API on MS Visual C++ compiler problem

    Excuse me
    I install BDB XML 2.3.8, and I use MS Visual C++ 6 compiler.
    In VC6, I add fellow path setting ~
    include files:
    C:\Program Files\Oracle\Berkeley DB XML 2.3.8\include
                                       C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\debug
                                       C:\Program Files\Oracle\Berkeley DB XML 2.3.8\include\dbxml
    Library files:
    C:\Program Files\Oracle\Berkeley DB XML 2.3.8\lib
                                       C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\debug
    Source files:     
    C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin
                                       C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\debug
    Executable files:     
    C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin
                                                 C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\debug
    and in Link setting, add 「 libdb45.lib libdbxml23.lib xerces-c_2.lib xqilla10.lib 」
    I write some test code:
    #include "stdafx.h"
    #include "DbXml.hpp"
    using namespace DbXml;
    int main(int argc, char* argv[])
         printf("= BDBtest Programe =\n");
         XmlManager myManager;
    try {
                   XmlContainer myContainer = myManager.createContainer("test.dbxml");
                   printf(" finish test.dbxml create \n");
              } catch (DbXml::XmlException &xe) {
                   // Error handling goes here
                   printf("!! error 1 !!\n");
                   printf ("%s\n", xe.what());
              } catch (std::exception &e) {
                   // Error handling goes here
                   printf("!! error 2 !!\n");
                   printf ("%s\n", e.what());
         return 0;
    but when I executable program, the screen print:
    !! error 2 !!
    bad allocationIf I have setting wrong, or missing some setting??

    And when I run in debug mode, it produce follow information..
    Loaded 'ntdll.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    Loaded 'C:\Documents and Settings\wang\compiler\VC6\BDBtest\Debug\libdbxml23.dll', no matching symbolic information found.
    Loaded 'C:\Documents and Settings\wang\compiler\VC6\BDBtest\Debug\libdb45.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcr71.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcp71.dll', no matching symbolic information found.
    Loaded 'C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\xerces-c_2_7.dll', no matching symbolic information found.
    Loaded 'C:\Program Files\Oracle\Berkeley DB XML 2.3.8\bin\xqilla10.dll', no matching symbolic information found.
    HEAP[BDBtest.exe]: Invalid allocation size - CCCCCCD0 (exceeded 7ffdefff)
    HEAP[BDBtest.exe]: Invalid allocation size - CCCCCCCD (exceeded 7ffdefff)
    First-chance exception in BDBtest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
    First-chance exception in BDBtest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
    First-chance exception in BDBtest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
    The program 'C:\Documents and Settings\wang\compiler\VC6\BDBtest\Debug\BDBtest.exe' has exited with code 0 (0x0).

  • Issues while iterating BDB XML

    Hello there,
    to begin with the issue, I've got a BDB XML, with couple of inserted documents. Using Java API.
    I'm creating an application which integrates the database within and displays the contents (that is, documents) of a container in a JTree.
    Next, I've overridden toString() of XmlDocument:
    class MyTreeModelChild extends XmlDocument{
        ContainerManager cmanager; //ContainerManager is the class, which deals with the environments settings, opening containers, putting documents etc.
        public MyTreeModelChild(XmlDocument v, ContainerManager cmanager) throws Exception{
            super(v);
            this.cmanager = cmanager;
        public String toString(){
            //executeQuery is the method, which executes XPath queries. It's located in ContainerManager class and takes a string argument
            try{
                XmlResults xResults = cmanager.executeQuery("collection('demo.dbxml')/info/title/string()");
                while(xResults.hasNext()){
                    XmlValue value = xResults.next();
                    return value.asString();
                return null;
            catch(Exception e){
                return e.toString();
    }The content of XML documents (don't mind the validation, that's an example):
    first.xml
    <info>
       <title>One</title>
    </info>
    second.xml
    <info>
       <title>Two</title>
    </info>Finally, I run the compiled code and watch the documents appear in the tree. They both have same titles (the second document is overridden by the first):
    -One
    -OneIf I check the query using dbxml shell, everything's nice:
    -One
    -TwoAny ideas, suggestions?
    Andy

    John,
    thank you for the reply.
    Indeed. The query returns the title of every document.
            try{
                XmlResults xResults = cmanager.executeQuery("collection('demo.dbxml')/info/title/string()");
                while(xResults.hasNext()){
                    XmlValue value = xResults.next();
                    return value.asString();
                }I execute the query and while it has some results to return, do the loop. Take the first value as a XmlValue and return it as String. If I have more results (in this case -- yes, I do), the loop runs again.
    Unfortunately, I cannot figure out what's from now on. The loop will return the same value.
    I'm nor a geek in BDB XML neither in Java. Almost there, just a few obstacles in the way :)

  • How to output full-text document from BDB-XML

    I put a XML document(test.xml) into BDB-XML; Edit and modify use BDB-XML API.
    After, if I want to output(roll out) my XML document(test.xml) which was storage in BDB-XML.
    Are there any support in BDB-XML API or Shell to output full-text document from DB??
    Thank you very much :)

    In the shell:
    dbxml> getDocument "document name"
    dbxml> print ["output_file_name"]
    In a (Java) program:
    XmlDocument doc = container.getDocument("document name");
    String output = doc.getContentAsString();
    Regards,
    George

  • Very urgent (bdb xml)

    actually in my requirement doc they mentioned that Berkely BD should use no more than 32 MB of shared memory.
    so what does it mean????????????
    i AM USING bdb xml ,SO wheather by enabling BD_INIT_MPOOLflag will serve this purpose.

    I am not quite sure of what you are asking, based on my understanding, the anser is:
    When you are setting the cache size via Berkeley DB API DB->set_cachesize, you can specify the cache size. And yes, you need to set DB_INIT_MPOOL in DB_ENV->open.
    If this is not the anwser you look for, can you describe your issue in much more detail?
    David

  • BDB XML 2.4 : Xquery from file

    Hi
    I am using BDB XML 2.4 (on Fedora Linux - C++) . Is it possible to run Xquery from xquery file (instead of placing the query string in a string variable)? If so please let me know what API i have to use?
    Thanks,
    Santhosh

    Hi Santhosh,
    DB XML doesn't provide API to do that directly. You'll have to write a small wrapper function that reads the file into a string and passes that to DB XML.
    John

  • Nested while defining class: com.sun.xml.ws.api.WSBinding ???

    Why is this happening, I am trying to access servlet, 2.4 on the Webshere 6.1, installation as succesfull and the servlet is running without exceptions.
      nested while defining class: com.sun.xml.ws.api.WSBinding
    This error indicates that the class: javax.xml.ws.Binding
    could not be located while defining the class: com.sun.xml.ws.api.WSBinding
    This is often caused by having the class at a higher point in the classloader hierarchy
    Dumping the current context classloader hierarchy:
        ==> indicates defining classloader
        *** indicates classloader where the missing class could have been found
    ==>[0]
    com.ibm.ws.classloader.CompoundClassLoader@51905190
       Local ClassPath: C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\classes;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\aopalliance-1.0.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\commons-logging-1.1.1.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxb-impl-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxb-xjc-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-rt-2.1.4.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-rt-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-spring-1.8.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jboss-j2ee.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jremote.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\log4j-1.2.9.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.aop-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.asm-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.beans-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.context-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.core-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.expression-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.jms-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.transaction-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.web-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\spring-batch-infrastructure-2.1.0.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\stax-ex-1.2.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\streambuffer-0.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\TWSCore.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\xbean-spring-3.4.3.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war
       Delegation Mode: PARENT_FIRST
       [1] com.ibm.ws.classloader.JarClassLoader@777399894 Local Classpath:  Delegation mode: PARENT_FIRSTEdited by: romanshtekelman on Sep 9, 2010 7:34 AM

    For future reference...
    We followed the following instructions and created a shared lib.
    http://download.oracle.com/docs/cd/E12524_01/web.1013/e12290/opensrc.htm#BABDDAIF
    We resolved most of our class loading issues.
    BR//Bahman

  • How to install BDB XML on shared server?

    Hi All,
    1. I want to install BDB XML on a shared server (bluehost). Can anyone suggest me how to do it? Since I dont have enough permissions, some of the 'php shared extensions' are not being installed. I get warning like-
    Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/
    cp: cannot create regular file `/usr/lib/php/extensions/no-debug-non-zts-20060613/#INST@343#': Permission denied
    make: *** [install-modules] Error 1
    2. Also, how can I add new libraries to library path? (Again no permission)
    Any help on these issues would be highly appreciated,
    Thanking you in anticipation.

    I'm talking about Berkeley DB XML, just in case it was not clear.

  • How to trigger xml publisher API (ex:Delivering Documents via e-Mail)?

    Dear All:
    How to use xml publisher API ?
    In user's guide always talk API's code.(ex:Delivering Documents via e-Mail
    // create delivery manager instance
    DeliveryManager dm = new DeliveryManager();
    // create a delivery request
    DeliveryRequest req =
    dm.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
    // set email subject
    req.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT, "Invoice");
    // set SMTP server host
    req.addProperty(
    DeliveryPropertyDefinitions.SMTP_HOST, "mysmtphost");
    // set the sender email address
    req.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
    "[email protected]");
    // set the destination email address
    req.addProperty(
    DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
    "[email protected], [email protected]" );
    // set the content type of the email body
    req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
    "text/html");
    // set the document file name appeared in the email
    req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
    "body.html");
    // set the document to deliver
    req.setDocument("/document/invoice.html");
    // submit the request
    req.submit();
    // close the request
    req.close(); )
    Not say how to use this code to account effect !!
    Having anybody to use API before?
    Please tell me how to use that,thanks!!
    BY Emily_ye

    Hi Emily
    I had the same question. After much research and a lot of deduction I produced the following:
    import oracle.apps.fnd.cp.request.*;
    import java.io.*;
    import java.sql.*;
    import java.util.Vector;
    import oracle.apps.fnd.util.*;
    import oracle.apps.xdo.XDOException;
    import oracle.apps.xdo.common.pdf.util.PDFDocMerger;
    import oracle.apps.xdo.delivery.DeliveryException;
    import oracle.apps.xdo.delivery.DeliveryManager;
    import oracle.apps.xdo.delivery.DeliveryPropertyDefinitions;
    import oracle.apps.xdo.delivery.DeliveryRequest;
    import oracle.jdbc.driver.OracleCallableStatement;
    public class RunTravProgram implements JavaConcurrentProgram {
    CpContext mCtx; // global reference to concurrent program context
    LogFile logFile; // global reference to context logfile
    OutFile outFile; // global reference to context outfile
    Connection mConn = null;
    ReqCompletion lRC;
    //File Separator
    private String mFileSeparator;
    // globals for template
    String XDOAppShortName = "";
    String XDOtemplateCode = "";
    // hard-wired constants for template addition
    final String XDOLanguage = "en";
    final String XDOTerritory = "US";
    final String XDOFinal_format = "PDF";
    final String XDOtemplateType = "TEMPLATE_SOURCE";
    String PDFFile = "";
    String outFilePath = "";
    String progShortName = "";
    String progDesc = "";
    Integer iRequestID = 0;
    String sWatermark = ""; // watermark text
    String emailAddress = ""; // Not Implemented
    String emailServer = "";
    public static final String M_SUCCESS = "SUCCESS";
    public static final String M_ERROR = "ERROR";
    public static final String M_WARNING = "WARNING";
    * Create a Java FND ConcurrentRequest objec to call fnd_request.submit_request
    * The first three parameters are:
    * Application Short Name -- Application Short name (ie. WAHC)
    * Current Program Short Name -- Concurrent Program being called
    * Current Program Description -- description for above
    * These should be the first three parameters passed by the concurrent
    * program in this order. The next two are constants set to null
    * These are followed by the parameters passed by the first concurrent
    * program that are being passed to the next concurrent program.
    * I am limiting the parameter list to ten for now.
    // Dynamic PLSQL statement used to get a concurrent request completion status
    // This is necessary because the java class does not provide this method :-(
    String mGetCompleteStatus =
    "DECLARE R_VAL BOOLEAN; " + "b_phase VARCHAR2 (80) := NULL; " +
    "b_status VARCHAR2 (80) := NULL; " +
    "b_dev_phase VARCHAR2 (80) := NULL; " +
    "b_dev_status VARCHAR2 (80) := NULL; " +
    "b_message VARCHAR2 (240) := NULL; " + "BEGIN " +
    "r_val := fnd_concurrent.wait_for_request (:1,5,1000," +
    "b_phase,b_status,b_dev_phase,b_dev_status,b_message); " +
    ":2 := b_phase; " + ":3 := b_status; " + ":4 := b_message; " + "end;";
    public RunTravProgram() {
    // no constructor necessary for now
    * Concurrent Processing provides an interface 'JavaConcurrentProgram' with abstract method
    * runProgram() which passes the concurrent processing context 'CpContext'. The concurrent
    * program developer will implement all of their business logic for a concurrent program in
    * runProgram(). The main() method, implemented by AOL, will call runProgram() after
    * performing all of the required initialization for the concurrent program, including
    * establishing a database connection, initializing the required contexts, and setting up
    * the log and output files. CpContext will have the request specific log and output
    * file input methods
    public void runProgram(CpContext pCpContext) {
    mCtx = pCpContext;
    OracleCallableStatement lStmt = null;
    boolean bCompletion = true;
    String sPhase = "";
    String sStatus = "";
    String sMessage = "";
    //get handle on request completion object for reporting status
    lRC = pCpContext.getReqCompletion();
    // assign logfile
    logFile = pCpContext.getLogFile();
    // assign outfile
    outFile = pCpContext.getOutFile();
    // assign fileseparator
    mFileSeparator = getFileSeparator();
    // get the JDBC connection object
    mConn = pCpContext.getJDBCConnection();
    outFilePath =
    ((new File(outFile.getFileName())).getParent() == null ? "" :
    (new File(outFile.getFileName())).getParent() +
    mFileSeparator);
    logFile.writeln("OutFile File Path: -> " + outFilePath, 0);
    // get parameter list object from CpContext
    // these come from the concurrent program
    ParameterList lPara = pCpContext.getParameterList();
    // create a temporary array and retrieve the parameters created by
    // the program. Currently limiting the number of parameters to 10 for now
    String pvals[] = new String[10];
    int pcount = 0;
    while (lPara.hasMoreElements()) {
    NameValueType aNVT = lPara.nextParameter();
    pvals[pcount] = aNVT.getValue();
    pcount++;
    if (pcount > 9)
    break;
    // send parameter values to the log file
    logFile.writeln("Arg 1: APPL_SHORT_NAME -> " + pvals[0], 0);
    logFile.writeln("Arg 2: CURR_PROG_SHORT_NAME -> " + pvals[1], 0);
    logFile.writeln("Arg 3: CURR_PROG_DESCRIPTION -> " + pvals[2], 0);
    logFile.writeln("Arg 4: TEMPLATE_CODE -> " + pvals[3], 0);
    logFile.writeln("Arg 5: P_PLANT_CODE -> " + pvals[4], 0);
    logFile.writeln("Arg 6: P_BATCH_NO -> " + pvals[5], 0);
    logFile.writeln("Arg 7: P_SHOW_PROMISE -> " + pvals[6], 0);
    logFile.writeln("Arg 8: P_WATERMARK -> " + pvals[7], 0);
    XDOtemplateCode = pvals[3]; // store the template name globally
    progShortName = pvals[1]; // store the program short name globally
    XDOAppShortName = pvals[0]; // store the application short name
    sWatermark = pvals[7]; // store the watermark globally
    progDesc = pvals[2];
    try {
    // create a concurrent request object
    ConcurrentRequest cr = new ConcurrentRequest(mConn);
    // use the parameters to call fnd_request.submit_request
    cr.addLayout(XDOAppShortName, XDOtemplateCode, XDOLanguage,
    XDOTerritory, XDOFinal_format);
    Vector param = new Vector();
    param.add(pvals[4]); // plant code
    param.add(pvals[5]); // batch ID
    param.add(pvals[6]); // Show SO info flag
    iRequestID =
    cr.submitRequest(XDOAppShortName, progShortName, progDesc,
    null, false, param);
    mConn.commit();
    // send the request ID to the log file
    logFile.writeln("-- Request ID: ->" + Integer.toString(iRequestID),
    0);
    // call fnd_concurrent.wait_for_request to wait until the request
    // has ended - use this to check the request status before proceeding
    lStmt =
    (OracleCallableStatement)mConn.prepareCall(mGetCompleteStatus);
    lStmt.setInt(1, iRequestID);
    lStmt.registerOutParameter(2, java.sql.Types.VARCHAR, 0, 255);
    lStmt.registerOutParameter(3, java.sql.Types.VARCHAR, 0, 255);
    lStmt.registerOutParameter(4, java.sql.Types.VARCHAR, 0, 255);
    lStmt.execute();
    // get the results of the completion
    sPhase = lStmt.getString(2);
    sStatus = lStmt.getString(3);
    sMessage = lStmt.getString(4);
    lStmt.close();
    // send the results of the request processing to the log file
    logFile.writeln("-- Phase: -> " + sPhase, 0);
    logFile.writeln("-- Status: -> " + sStatus, 0);
    logFile.writeln("-- Message: -> " + sMessage, 0);
    // test here to make sure it completed correctly
    if (sPhase.equals("Completed") && sStatus.equals("Normal")) {
    // construct the PDF file name generated by the called request
    PDFFile = progShortName + "_" + iRequestID + "_1.pdf";
    // add a watermark to the generated PDF
    // create an output stream for the existing PDF
    // and set ouput to append
    OutputStream pdfout =
    new FileOutputStream(outFilePath + PDFFile, true);
    // create an inputstream array (required by calling method)
    InputStream pdfin[] = new InputStream[1];
    pdfin[0] = new FileInputStream(outFilePath + PDFFile);
    // add the watermark passed as a parameter
    bCompletion = addWatermark(pdfin, pdfout);
    // assign the modified file to the context out
    // this will print using this request
    if (bCompletion)
    outFile.setOutFile(outFilePath + PDFFile);
    // release the connection object
    // and set the completion status for the request
    if (bCompletion) {
    pCpContext.getReqCompletion().setCompletion(ReqCompletion.NORMAL,
    } else {
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (SQLException s) {
    logFile.writeln("SQL Error: Exception thrown w/ error message: " +
    s.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (IOException ioe) {
    logFile.writeln("IO Error: Exception thrown w/ error message: " +
    ioe.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (Exception e) {
    logFile.writeln("General Exception: " + e.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } finally {
    try {
    if (lStmt != null)
    lStmt.close();
    pCpContext.releaseJDBCConnection();
    } catch (SQLException e) {
    logFile.writeln(e.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    * addWatermark()
    * @param pdfin
    * @param pdfout
    * @return boolean
    * This method will work for an existing document or a newly generated
    * one. Set the outputstream append flag to false for a new document
    * and true for an existing one.
    * NOTE: PDFDocMerger requires an inputstream array even if it only
    * contains one document.
    private boolean addWatermark(InputStream[] pdfin, OutputStream pdfout) {
    if (!sWatermark.equals("")) {
    try {
    PDFDocMerger docMerger = new PDFDocMerger(pdfin, pdfout);
    //docMerger.setTextDefaultWatermark(sWatermark);
    docMerger.setTextWatermark(sWatermark, 80f, 50f);
    docMerger.setTextWatermarkAngle(25);
    docMerger.setTextWatermarkColor(1.0f, .50f, .50f);
    docMerger.setTextWatermarkFont("Garamond", 100);
    docMerger.process();
    docMerger = null;
    return true;
    } catch (XDOException e) {
    logFile.writeln("Watermark process Failed: " + e.getMessage(),
    0);
    return false;
    return true;
    * Returns the file separator
    private String getFileSeparator() {
    return (System.getProperty("file.separator"));
    * EBSEmailDelivery
    * @return
    * Just for testing right now.
    private boolean EBSEmailDelivery() {
    if (!emailAddress.equals("")) {
    try {
    // create delivery manager instance
    DeliveryManager delMgr = new DeliveryManager();
    // create a delivery request
    DeliveryRequest delReq =
    delMgr.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
    // set email subject
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT,
    "EBS Report:" + progDesc +
    " for request: " + iRequestID);
    // set SMTP server host
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_HOST,
    emailServer); // need to supply the email smtp server
    // set the sender email address
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
    emailAddress);
    // set the destination email address
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
    emailAddress);
    // set the content type of the email body
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
    "application/pdf");
    // set the document file name appeared in the email
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
    PDFFile);
    // set the document to deliver
    delReq.setDocument(outFilePath + PDFFile);
    // submit the request
    delReq.submit();
    // close the request
    delReq.close();
    return true;
    } catch (DeliveryException de) {
    logFile.writeln("email process Failed: " + de.getMessage(), 0);
    return false;
    return true;
    This is the class for a JCP I created to perform the following:
    1) Launch an existing Concurrent Program that produces PDF output
    2) Grab the PDF and apply a watermark based on user input or conditions
    3) associate the modified PDF to CP output for PASTA printing
    It isn't elegant but it is fairly simple. I added the email capability and tested it but am not implementing it at the present time.
    there is a fair amount of information out there that explains how to create a JCP councurrent program but very little that demonstrates the class needed.
    I hope this helps

  • BDB XML 2.2.13 on Linux (CentOs)

    I installed BDB XML 2.2.13 on Linux machine. I have a few questions:
    1. How do I set DB_HOME so that I don't need to give directory each time I run dbxml?
    2. How do I create a container inside of another container: by saying this, the path I am looking for is db/tv_show. I want to have a container called "db" and inside of the container would be "tv_show"
    3. How can I list all the containers that I have already created?
    Thanks.

    Hi Agnes,
    1) DB_HOME was broken in DB XML 2.2.13. It has been fixed in DB XML 2.3.9, which I suggest you upgrade to.
    2) DB XML does not directly support creating containers inside other containers. You could emulate this behaviour using a custom XmlResolver, but for performance reasons I don't suggest you do that.
    3) DB XML does not keep track of what containers exist - that is left for the user application to do. Most people find that this isn't necessary, but if it is a simple solution is to create a known container specifically to hold this information.
    John

  • Installing BDB XML and including it into a java application

    Hi there :)
    I'm new to BDB XML and I've got some questions about it :
    1/ The documentation says about BDB XML that it is based on BDB. Does it mean that I need to install the standard BDB first to use BDB XML ? (I'm pretty sure I don't have to but I would like a confirmation =))
    2/ I want to developp a web application which will use BDB XML. The documentation says I need to add some jars into my project to use it but do I need to install it on my computer (Windows XP) first ? (with the .msi file ?)
    3/ Where will the xml files be physically stored after I add them into the database ? (what is the default database folder on the hard disk ?)
    Thank you for you help :)
    Regards,
    Gary

    Hi Gary,
    1) You need to install only DB XML. BDB is bundled with DB XML, so you don't have to worry.
    2) Yes, you need to add two jars: db.jar and dbxml.jar. But these jars depend on native DB XML libraries, so you will have to install DB XML anyway: only jars wouldn't be sufficient. Moreover, I would recommend to install DB XML from sources providing the --enable-java+ flag to the buildall.sh script
    3) All XML files will be stored in a container or containers (depending on how many of those you will decide to utilize in your application). It is up to you where you are going to reside DB XML environment/containers -- DB XML is quite low-level XML-database.
    Hope this helps,
    Vyacheslav

  • Some doubt about Bdb XML Normal Recovery

    Hi, everyone
    I have read the document Getting Started with Transaction Processing for Java shipped with Bdb XML 2.4.13. In the book, there is something about Normal Recovery:
    Normal recovery is run only against those log files created since the time of your last checkpoint.To test this, I have designed a scenario as below:
    The ENVIRONMENT directory is under E:/bdb-xml/environment, and the BACKUP directory is under E:/bdb-xml/backup, the CONTAINER name is entry.dbxml, and there is already a document 1.xml in this container.
    1. run db_recover against ENVIRONMENT.
    2. copy entry.dbxml to BACKUP.
    3. create a document 2.xml.
    4. run checkpoint against ENVIRONMENT.
    5. modify document 1.xml.
    6. run checkpoint against ENVIRONMENT.
    7. copy log.0000000001(there is only one log file in ENVIRONMENT) to BACKUP, Note that I didn't copy the entry.dbxml in ENVIRONMENT.
    8. run db_recover agaist BACKUP(now there are 2 files : entry.dbxml, log.log.0000000001).After that, I used the BACKUP as environment directory, and try to query 2.xml. And I retrieved the document correctly, which I feel very curious. As the document says, the last checkpoint is created by step 6, after that, there is no other modifications happens, so the modification happened at step 3 and step 5 will not take effect when db_recover executed. But the two changes have committed to entry.dbxml.
    So, which is the last checkpoint. And what is the those log files created since the time of your last checkpoint.
    I also want to know where the checkpoint be writen, in the db files or the log files.
    thanks advance.
    Regards,
    John Kao.

    Jhon,
    You really do want to know the gory details don't you? :-)
    Running recovery in your backup directory will cause the container there to pick up all changes from the log file that it does not yet have. The checkpoint on the original container doesn't mean anything to the backup container.
    Let me point you to even more interesting documentation that is in the Berkeley DB documentation set. This page has all of the BDB documentation, including links that are not included in the BDB XML doc:
    http://www.oracle.com/technology/documentation/berkeley-db/db/index.html
    The "Getting Started with Transaction Processing" documents on that page have the sort of information you seem to want.
    Regards,
    George

  • Correct installation of BDB XML on Mac OS X, and use with XCode

    I downloaded the tarball, compiled the whole thing without a problem, and then copied the contents of the install directory to /usr/ (trying to change the prefix on the configure script stopped it from compiling, for some reason) because I didn't want to add stuff to my path (and the contents looked like they belonged in /usr anyway)
    But now I'm not sure how to get XCode to find the search paths and libraries. Does anyone who has a working installation of BDB XML on mac os feel like giving me some pointers as to how they did it?
    Thanks,
    Daniel Peebles

    I don't know the exact answer to your question, but you can probably figure it out on your own like:
    1) Create a File object that represents an existing file. Play around with the path until the file can be found.
    2) Now that you have a File object representing a valid, existing path, use MyFile.getAbsolutePath() to see what the full path string is. MyFile.getCanonicalPath() might provide some answers as well.
    Whatever getAbsolutePath() returns is the correct format for the file path string.

  • Multimedia Information on BDB XML

    Hello,
    I was searching on google for some databases that support multimedia information, as the project I'm working on will need it. Most DBMSes provide a BLOB field where you can store any kind of MM information on it.
    Some folks advised me to use the filesystem itself and avoid the DB for this kind of storage. But I wonder, how can you assure integrity, if the information on the fs can be moved, erased, changed in so many ways, and the DB would be unaware of this. I dont think this is a good solution.
    So, does BDB XML provide support for MM information?
    thanks,
    -- Breno Jacinto

    Breno,
    Storing binary information in BDB XML metadata or in Berkeley DB records would maintain the integrity of the data, and ensure that it's as safe as the rest of your data. It also makes backup/restore of the complete system simpler. The arguments against doing this include:
    o storing/retrieving binary data happens through the cache, so your cache ends up abused by the binary information, possibly flushing valuable information such as indexes and frequently-accessed content. This has performance implications, and can result in more disk activity when querying your containers than would normally occur.
    o without special streaming support, it's hard to stream binary data reliably from the database (not a problem if your data is relatively small)
    As for storing binary info in the file system and linking it (via names) to your XML, it's not hard to provide as much protection for that data as you do for your database. The database files are just files in the file system themselves, and subject to the same attacks as normal files.
    If you protect your binary files with the same level of protection as your database files, they are safe. The major down sides of separate storage are:
    o you don't have transactions on the file system, so you need to program in a way to ensure that your database and binary data are in sync.
    o backup and restore are more complicated (mentioned above)
    Better support for large binary objects is on the list for a future release of Berkeley DB, and that support will address the issues; however, that's not an option today.
    I hope this helps,
    George

Maybe you are looking for