Accessing a Database from multiple threads

I would like to create a database application where more then one thread can access this database at once. What is the best way to synchronize access to it so as to prevent errors?

Actually, I wasn't thinking of using an SQL database since I haven't studied it. But, would it be a good idea to have one object of type "Database", and use 'synchronize' to control thread access?
Also, the database access needs to be restricted based on different users, so I am using a SecurityManager. I was thinking the structure would look something like this:
security manager
database manager
database
in this way, a request to retrieve data from the database would need to be requested from my security manager. If the request is allowed, it would be filtered down to the database manager. Is this the best way to do this?
And finally, someone told me that using something like an "event queue" to access data would work but I've never tried this. My database manager thread would process the requests one at a time. would this work well?

Similar Messages

  • Synchronize work from multiple threads using wait() and notifyAll() help

    Hello folks,
    (Sorry for my bad english)
    My current project handles multiple access requests to a shared collection from multiple threads originating from different classess and methods. Therefor I need to keep track of the order in which the Threads access that collection. I wrote a sort of Buffer class that has a static instance entry which initiate a new Instance of my Buffer class, attributes the instance a cue number and return the instance to the caller Thread.(Just like when you go to a supermarket and draw a number to wait to get served at the cheese counter).The callerThread then uses this instance to execute a method within the buffer class. Inside the buffer class method, I want to set a while loop on wait() just like this:
    while(currentCue != myCueState)
    wait();
    when all other prior method calls within my Buffer class are done, the loop should wake up using a notifyAll() call and check the condition "currentCue != myCueState" agen to see if its turn has come.
    I am new to the wait() and notifyAll() stuff and are therefor not sure what I am dooing wrong here: The only way this buffer class finishes all it's cues is when the caller Threads are beeing executed in the same order than they have checked in to the Buffer class. Otherwise I get some sort of dead-lock in the middle. Here is my code for the Buffer class:
    public class Buffer{
        private static int currentCue = 0;
        private static int lastCued = 0;
        private int myCueState;
        private Buffer myInstance = null;
        synchronized void doTaskOne(){      
            try{
                while(currentCue != myCueState)
                    wait();           
                //Do your task now
                System.out.println("doTaskOne got Executed: "+currentCue);
                currentCue++;
                notifyAll();
            catch(Exception a){}
        synchronized void doTaskTwo(){
             try{
                while(currentCue != myCueState)
                    wait();
                //Do your task now
                System.out.println("doTaskTwo got Executed: "+currentCue);
                currentCue++;
                notifyAll();
            catch(Exception a){}
        synchronized void doTaskThree(){
            try{
                while(currentCue != myCueState)
                    wait();          
                //Do your task now
                System.out.println("doTaskThree got Executed: "+currentCue);
                currentCue++; 
                notifyAll();
            catch(Exception a){}
        synchronized Object getSomething(){
            try{                   
                while(currentCue != myCueState)
                    wait();           
                //Do your task now
                System.out.println("getSomething got Executed");
                currentCue++;
                notifyAll();
            catch(Exception a){}
            return "something";
        //Access the buffer class through a single static synchronized instance and draw a turn number
        public synchronized Buffer instance(){
            myInstance = new Buffer();
            myInstance.setMyCueState();
            return myInstance;
        private void setMyCueState(){
             myCueState = lastCued;
             lastCued++;
    }and here for the Test class I have coded to test this:
    public class TestBuffer{
         private Buffer accessOne;
         private Buffer accessTwo;
         private Buffer accessThree;
         private Buffer accessFour;
         public TestBuffer(){
                    //Instantiate different instances from Bufferclass and draw a number
              accessThree = new Buffer().instance();
              accessOne = new Buffer().instance();
              accessTwo = new Buffer().instance();          
              accessFour = new Buffer().instance();
              Thread one = new Thread(){
                   public void run(){
                        accessOne.doTaskOne();
              Thread two = new Thread(){
                   public void run(){
                        accessTwo.doTaskTwo();
              Thread three = new Thread(){
                   public void run(){
                        accessThree.doTaskThree();
              Thread four = new Thread(){
                   public void run(){
                        accessFour.getSomething();
              try{               
                   one.start();                    
                   two.start();
                   three.start();     
                   four.start();                         
              catch(Exception f){}
         public static void main(String args[]){
              TestBuffer myTest = new TestBuffer();
    }What am I doing wrong here??
    Maby this is not how I should use the notifyAll() method, but how then?
    Please give me a solution!
    Thanks

    Ok, so if I get you guys right, the following should do it:
    public class Buffer{
        private static Object sharedLock = new Object();
        public void doTaskOne(){      
              synchronized(sharedLock)  {
                System.out.println("doTaskOne got Executed: ");
        public void doTaskTwo(){
             synchronized(sharedLock)  {
                System.out.println("doTaskTwo got Executed: ");
        public void doTaskThree(){
             synchronized(sharedLock)  {
                  System.out.println("doTaskThree got Executed: ");
        public Object getSomething(){
            synchronized(sharedLock)  {
                System.out.println("getSomething got Executed");
                return "something";
    }Lets say that each method accesses the same ressources (in this case a table model) to retreave values, delete rows and set some existing values vith new values and all this 20-30 times a minute, all processing will stay synchronised and collision is not possible?
    And lets say I would update the Table model directly from the buffer Class using MyTableModel.instance().setValueAt() or watever methods I implemented on my Table model, could I safely do that using "SwingUtilities.invokeLater();" from my BufferClass just like this:
    public void doTaskThree(){
            synchronized(sharedLock)  {
                   Runnable runme = new Runnable(){
                         public void run(){
                                MyTableModel.instance().setValueAt("abc", 5,5);  
                   SwingUtilities.invokeLater(runme);
    }Thanks in advance for your help guys!

  • Trying to access 10gr2 database from sqlplus utility but it connects to 11g

    Hi All,
    I am facing below issue while access 10gr2 database from sqlplus.
    I am having two oracle homes on one server one belongs to 11gr2 and another belongs to 10gr2.
    I want to access a 10gr2 database through sqlplus utility.but instaed of connecting to 10gr2 it is connecting to 11gr2 after I enter a user name and passowrd.
    I have set all the env variables such as oracle_home ,oracle_sid and path with respect to Oracle 10gr2.
    Can you please let me kno what I need to do to connect to 10gr2 database and not 11gr2 database through sql plus.
    Let me know if I need to give any more details on this.
    Best Regards,
    Dipti S

    Hi Rocky,
    I got the resolution.
    I made a mistake by creating an oracle instance/service(e.g. fsdmo) when Oracle_home was pointing to 11gR2 Directory.so that service was refering to 11gr2 oracle home.
    hence when I was setting oracle_sid(fsdmo) and trying to access database instance from 11g sqlplus utility ,it was directing to 11g and not 10g since oracle service was pointing to 11g.
    So now after chnaging the oracle home directory to 11g,I am creating a service and its working fine.
    thank you so much for responding.
    hope I am clear with my reply.
    Best Regards,
    Dipti S

  • WHY can't I access my database from an applet???????????

    The security code won't let my applet access its own database (from its own server)..
    I'm using getDocumentBase()
    to try and tell it that it is my own damn file..
    I keep getting :
    java.securityAccessControlException: access denied <java.util.PropertyPermission jdbc.drivers write>
    ...etc.
    This applet crap is really starting to piss me off. I can see why they came out with JSP.
    All I need to do is access my database, update it, etc. It kind of defeats the purpose of being able to do jdbc from applets if you can't even access the database on your own damn server.
    If you all don't have a clue, I'm freakin switching to PHP--I'm tired of this crap-I was thinking Java was a damn good language until I hit applets.

    The simple answer to your question is: Because of security concerns.
    The somewhat longer answer is that directly accessing a database from an applet is generally not a good idea. A lot of security-critical code like DB username/password must be hidden in the applet which potentially can be downloaded (and disassembled) by anyone that hits your webpage. Maybe you do an intranet solution with trusted users but that is not what applets were originally designed for.
    The clean way is to make your applet talk to a servlet that talks to your database.
    If that is not the way you want to do it, make sure that all client policy files (yes, on the browser machine) contain the permissions that your applet needs.

  • Calling System.exit() from multiple threads

    Hi,
    Why would calling System.exit() from multiple threads cause all the threads to block?
    Laith

    Thanks for your replies.
    I made further tests and the problem is actually not as I described it first.
    I'm using a shutdown hook that would stop all running threads if the program is stopped externally (using ctl-c for example) (I'm not using Thread.stop(), but setting a boolean value to false that would make the thread exit a while() loop in run()) .
    One of the running threads would call System.exit(-1) just before it would exit run().
    This thread is getting blocked if it is stopped by the shutdown hook.
    I know that this is a bad coding practice, bout would still appreciate an explanation to the reason why the thread is actually blocked by System.exit().
    Laith

  • DBXML 2.4.16:  Accessing containers from multiple threads and deadlock

    Hi,
    I am evaluating dbxml for my upcoming project (http://xcapserver.sourceforge.net) where I am sending following four requests through multiples threads which gets into deadlock situation after running certain iterations. Can you please help me what am I doing wrong?
    1. Put Document
    2. Get Document
    3. Get Document Node (XPATH Query)
    4. Delete Document
    I am using following environment variables.
    u_int32_t env_flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |DB_INIT_TXN | DB_THREAD|DB_RECOVER| DB_AUTO_COMMIT; (I tried removing DB_AUTO_COMMIT)
    dbEnv_.open(dbxml_env.c_str(), env_flags, 0);
    XmlManager instance is initialized as :pxmlmgr_= new XmlManager(&dbEnv_) ;
    pxmlmgr_->setDefaultContainerType(DbXml::XmlContainer::WholedocContainer);
    NOTE: pxmlmgr_ instance is member variable of singleton class assuming XmlManager is thread safe and can be reused for all threads.
    Below is the psudo code. It is written in C++. I have removed exception handling and other code for clarity.
    getDocument (...){
    XmlTransaction containerTxn =pxmlmgr_->createTransaction();
              XmlContainer cont = pxmlmgr_->openContainer(container, DB_RDONLY|DB_THREAD);
              XmlDocument doc = cont.getDocument(document);
              containerTxn.commit();
              data = doc.getContent(data
    NOTE: To use doc(...) function, I have to create an alias than only I can use container name e.g /dbxml/resource-lists/users/rjoshi where /dbxml is env_home.
    container name: /dbxml/resource-lists/users/rjoshi (here rjoshi is container name)
    document name: presence
    getDocumentNode(...) {
    size_t npos = container.find_last_of("/", container.length());
              std::string alias = container.substr(npos+1, container.length()-npos) + "_" + document;
                   XCAP_DEBUG("Alias:" + alias);
                   std::string fullQuery = "doc('dbxml:" + alias + '/' + document + "')" + node;
                   XCAP_DEBUG("XPath Full Query:" + fullQuery);
                   XmlTransaction txn = pxmlmgr_->createTransaction();
                   XmlContainer cont = pxmlmgr_->openContainer(container, DB_RDONLY|DB_THREAD);
                   cont.addAlias(alias);
                   //query context
                   XmlQueryContext context = pxmlmgr_->createQueryContext();
              XmlResults results(pxmlmgr_->query(fullQuery, context ) );
                   cont.removeAlias(alias);
                   txn.commit();
    putDocument(....){
    size_t npos = container.find_last_of("/", container.length());
              std::string dir = container.substr(0, npos);
                   boost::filesystem::path p(dir);
                   if(!boost::filesystem::exists(p)) {
                        boost::filesystem::create_directories(p);
                   XmlTransaction txn = pxmlmgr_->createTransaction();
                   XmlContainer cont = pxmlmgr_->openContainer(container, DBXML_TRANSACTIONAL|DB_THREAD|DB_CREATE);
              XmlUpdateContext updateContext = pxmlmgr_->createUpdateContext();
                   cont.putDocument(document, data, updateContext, 0);
                   txn.commit();
    deleteDocument() {
    XmlTransaction txn = pxmlmgr_->createTransaction();
              XmlContainer cont = pxmlmgr_->openContainer(container, DB_THREAD);
              XmlUpdateContext updateContext = pxmlmgr_->createUpdateContext();
              cont.deleteDocument(document, updateContext);          
              txn.commit();
    }

    1. What platform are you on?
    rjoshi>>I am running on mac OSX 10.5.8
    2. There are still some potential coding issues here:
    2a. In DbXmlDb.hpp there is a DbEnv instance which is
    a member of your class. If using DbEnv as a data member
    it is usually best to use new/delete vs making it a member.
    rjoshi>>I have modified code to use new/delete
    2b. In DbXmlDB.cpp DBXML_ADOPT_DBENV is being used.
    DBXML_ADOPT_DBENV requires that DbEnv be created via
    new() as it calls delete() on it.
    rjoshi>> modified code to use new/delete
    2c. In general is it best not to open containers upon
    each use. Containers should be opened and shared among
    threads.
    rjoshi>> In real application, multiple devices (e.g IM, Phone) can read/write same document but it's not always the case so I don't want to open the container and keep in the memory. There is no way for me to know when to close the container. Is there any way to set flag where container can be open for certain duration and if not used, it will get closed and removed from memory?
    2d. Instead of using a transaction for opening containers
    use DBXML_TRANSACTIONAL|DB_THREAD. Also the use of
    DB_RDONLY in the read cases will not change anything significant
    as open instances are shared and the state of the first
    one is the only one that counts.
    rjoshi>> In init() function, I am setting default container flags as
    pxmlmgr_->setDefaultContainerFlags(DB_CREATE | DB_THREAD
                   | DBXML_TRANSACTIONAL);
    Do I still need to set these flags while opening the container?
    2e. The setting of DB_THREAD looks to be used inconsistently.
    It should be used all the time if the application is
    making use of threading.
    rjoshi>> Again I was setting default flag for container as below in the init() function so was not using it. I have corrected the inconsistency.
    pxmlmgr_->setDefaultContainerFlags(DB_CREATE | DB_THREAD
                   | DBXML_TRANSACTIONAL);
    2f. I can not tell for sure from looking at the cpp file,but
    just make sure that operation-based transactions are consistently
    passed in the application.
    rjoshi>> I have removed transactions while opening the container and using all other places.
    Still I am able to reproduce the deadlock. Please see the below output of db_state -CA.
    bash-3.2$ ./db_stat -h /dbxml/ENV -CA
    Default locking region information:
    3327     Last allocated locker ID
    0x7fffffff     Current maximum unused locker ID
    9     Number of lock modes
    1000     Maximum number of locks possible
    1000     Maximum number of lockers possible
    1000     Maximum number of lock objects possible
    39     Number of current locks
    143     Maximum number of locks at any one time
    75     Number of current lockers
    313     Maximum number of lockers at any one time
    12     Number of current lock objects
    26     Maximum number of lock objects at any one time
    6643     Total number of locks requested
    6560     Total number of locks released
    0     Total number of locks upgraded
    2166     Total number of locks downgraded
    531     Lock requests not available due to conflicts, for which we waited
    9     Lock requests not available due to conflicts, for which we did not wait
    0     Number of deadlocks
    0     Lock timeout value
    0     Number of locks that have timed out
    0     Transaction timeout value
    0     Number of transactions that have timed out
    464KB     The size of the lock region
    60     The number of region locks that required waiting (0%)
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock REGINFO information:
    Lock     Region type
    7     Region ID
    /dbxml/ENV/__db.007     Region name
    0xf000     Original region address
    0xf000     Region address
    0xf044     Region primary address
    0     Region maximum allocation
    0     Region allocated
    Region allocations: 3005 allocations, 0 failures, 0 frees, 1 longest
    REGION_JOIN_OK     Region flags
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock region parameters:
    786457     Lock region region mutex [60/23741 0% 12394/0]
    1031     locker table size
    1031     object table size
    436     obj_off
    45860     locker_off
    1     need_dd
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock conflict matrix:
    0     0     0     0     0     0     0     0     0     
    0     0     1     0     1     0     1     0     1     
    0     1     1     1     1     1     1     1     1     
    0     0     0     0     0     0     0     0     0     
    0     1     1     0     0     0     0     1     1     
    0     0     1     0     0     0     0     0     1     
    0     1     1     0     0     0     0     1     1     
    0     0     1     0     1     0     1     0     0     
    0     1     1     0     1     1     1     0     1     
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by lockers:
    Locker Mode Count Status ----------------- Object ---------------
    c3e dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c3e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c41 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c42 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c42 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c45 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c46 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c46 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    c49 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c4a dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c4a READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    c4d dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c4e dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c4e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    c51 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c52 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c52 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    c52 READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c55 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c59 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c59 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    c5c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c5d dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c5d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    c5d READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c60 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000325 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000326 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    80000326 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000326 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    80000327 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c8e dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    80000328 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    80000328 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000328 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032a dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c91 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032b dd= 0 locks held 3 write locks 1 pid/thread 12389/0
    8000032b WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032b READ 7 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b WRITE 14 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b READ 3 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032c READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c93 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032d dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c94 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032e dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032e READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c95 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    8000032f dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000330 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000330 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000331 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000332 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000332 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c99 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c99 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    80000333 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000333 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000334 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000334 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000335 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    c9c dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000336 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    80000336 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c9d dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    c9d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    ca0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca1 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca1 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    ca4 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca5 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca5 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    ca8 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ca9 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    ca9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    cac dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cad dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    cad READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    cad READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cb0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cb4 dd= 0 locks held 1 write locks 0 pid/thread 12389/0
    cb4 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    cb7 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cb8 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    cb8 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    cb8 READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cbb dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ce9 dd= 0 locks held 2 write locks 0 pid/thread 12389/0
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cec dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    ced dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cee dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cef dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf0 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf1 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf2 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf3 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf4 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf5 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf6 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf7 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf8 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cf9 dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfa dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfb dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfc dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfd dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cfe dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    cff dd= 0 locks held 0 write locks 0 pid/thread 12389/0
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Locks grouped by object:
    Locker Mode Count Status ----------------- Object ---------------
    80000326 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    80000328 READ 2 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032b READ 3 HELD /dbxml/resource-lists/users/rjoshi page 11
    8000032b WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032c READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    8000032e READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000330 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000332 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000333 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000334 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    80000336 READ 1 WAIT /dbxml/resource-lists/users/rjoshi page 11
    c4e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    ca9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 10
    c4a READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    ca5 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 8
    c59 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    cb4 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 14
    8000032b WRITE 14 HELD /dbxml/resource-lists/users/rjoshi page 13
    8000032b READ 7 HELD /dbxml/resource-lists/users/rjoshi page 13
    80000328 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    80000326 WRITE 1 WAIT /dbxml/resource-lists/users/rjoshi page 13
    c52 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    cad READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 12
    c3e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c99 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 2
    c52 READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c5d READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cad READ 6 HELD /dbxml/resource-lists/users/rjoshi handle 0
    cb8 READ 2 HELD /dbxml/resource-lists/users/rjoshi handle 0
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 0
    c46 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    ca1 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 6
    c42 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c9d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 4
    c8e READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    ce9 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 18
    c5d READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16
    cb8 READ 1 HELD /dbxml/resource-lists/users/rjoshi handle 16

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • Access oracle database from microsoft access?

    It is possible access to an'ORACLE database from Microsoft Access?

    Yes, that's possible.
    You can find several threads for this on the forum,e.g.
    Oracle & MS Access

  • Accessing mysql database from oracle using dg4odbc

    I've been trying to create a database link from a MySQL database to Oracle using the Oracle dg4odbc gateway. I downloaded and installed DataDirect's ODBC package which includes mysql ODBC library (ddmysql24.so) and a generic ODBC libary (libodbc.so). After creating the DSN in odbc.ini, I tested it and it can connect to the mysql database. Then I created the init{SID}.ora file in hs/admin directory, added dg4odbc lines in the listener.ora, and added lines in tnsnames.ora. Then I tnspinged the new SID with success. Finally, I created the database link. However, when I tried to access the database link using the commands "select * from mdl_user@moodle;", I got the ORA-28500 error like the following:
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [DataDirect][ODBC 20101 driver][20101]You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for the right
    syntax to use near '"mdl_user"' at line 1
    ORA-02063: preceding 2 lines from MOODLE
    My mysql database is utf8 by default. Do I have to use latin1?
    It seems to me that the dg4odbc translates the sql commands incorrectly (having double quotes around the selected table).
    Any help is greatly appreciated.
    Jeffrey

    The syntax error occures for example when MySQL isn't running in ANSI mode and thus does not allow double quotes around the objects. DG4ODBC 11.1.0.6 by default always adds double quotes to table/column/view names.
    A quick test to check if you hit the double quote issue would be to set the MySQL DB into ANSI mode:
    - Open SQL*Plus
    - execute:
    DECLARE
    ret integer;
    c integer;
    BEGIN
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@moodle;
    DBMS_HS_PASSTHROUGH.PARSE@moodle(c, 'SET SESSION SQL_MODE=''ANSI_QUOTES'';');
    ret := DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@moodle(c);
    dbms_output.put_line(ret ||' passthrough output');
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@moodle(c);
    END;
    - Now run your select statement
    => if it now works, you can permanently change the MySQL config to be ANSI compliant or you can apply the 11.1.0.7 patchset to DG4ODBC.

  • Accessing another database from HTMLDB

    All is there a way to do selects on another database from within an HTMLDB application.

    We have several applications on our intranet, all requiring login & password. I was unable to hit the needed tables directly outside the application as I'm not a DBA and they've never given me access to the schema names. So while trying to connect to those same tables as I do with Crystal Reports, I just went to the network drive where the TNSNAMES file is located, hunted for the IP of the server I was looking for, used that SID and did the following:
    Database Link Name - (whatever I want)
    Connect to Schema - (used my username that I use with crystal)
    Password - (same password used in crystal)
    Remote Hostname or IP - used stolen IP found in TNSNAMES
    Remote Host Port - used port found in TNSNAMES
    SID or Service Name - same as in crytal but also found in tnsnames.
    After that I had no problem hitting the tables I wanted as my username and login gets me the access I need.
    I can't tell for sure why I don't need the actual schema name and why my username works instead. I'm just glad it does as I can now use the necessary tables to do MY authentication scheme without relying having to ask to get access to the scheme used by the department. They wouldn't give it to me anyway:)
    Hope that helped, I know it didn't explain why it works tho.
    Not sure what you mean by the SQL query... that is done for you in HTML DB in the connect string created by the link.
    If you mean how do you hit the link you use it prefaced by the at sign "@" as in gimme what I want from the database @(the link name you made)

  • Access DB2 database from IRIX machine.

    Hi ,
    I am using DB2 database ,which is sitting on AIX machine.
    And i want to access database from IRIX 6.5 (SGI machine).
    I think there is no driver to connect DB2.
    If any body knows how to access
    Thank you for your help.

    Since I've never used DB2, and Irix last ten years ago, I feel fully qualified to answer :-)
    Get a JDBC driver. Googling for db2 jdbc driver site:ibm.com gives 3860 hits; remove site:ibm.com if you are interested in third party drivers.
    Check if your DB2 installation contains the file db2jcc.jar - that seems to be the "DB2 Universal JDBC Driver", apparently a Type 4 driver (type 4 is a Good Thing). I can't find offhand if the driver is a separate product or comes with DB2.
    Check out e.g. http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/t0010264.htm

  • Efficient access to database from web services

    Hi
    I'm implementing a web service interface to a database. The interface allows its clients to perform a series of independent operations which change some values in a database. Each of these operations is an independent web service, but all of them use the same database.
    My first approach was to make each service completely self-contained, and have it create its own JDBC connection to access the database. However this doesn't sound very efficient.
    I mean, isn't the application server there precisely to provide these types of services to the applications it hosts? So, is it possible to have it manage a pool of connections of some kind and make the web services get their connections from that pool?
    Thanks in advance
    Pedro

    Hi Cemal,
    Try the following.
    IWDClientUser user  = WDClientUser.getCurrentUser();
    user.getSAPUser().getUniqueName();
    Please check old postings in the forum.
    Regards, Anilkumar

  • How to access MDB database from JSP Web Application?

    hi
    i am using tomact and developing appplication in which i have to insert data into MDB database and read/Update/Delete Data in MDB DataBase.
    could any help in this issue?
    Thanks
    Regards
    Oersla Afroze Ahmed

    Hi,
    For accessing MDB database, you must have a jdbc:odbc driver, u can get it from sun site.
    just put it into the lib folder of web server.
    or
    just follow the following link:
    http://www.developer.com/db/article.php/3571661
    keshri

  • Access Canon MX860 from multiple accounts on iMac over WiFi

    I bought a Canon PIXMA MX860 yesterday and set it up using my account on our iMac running 10.5.6. The printer is connected over WiFi. I can print and scan from my account.
    When I try to print from another account on the iMac (my wife as an account and we have a guest account) the printer queue says "Printer is currently off-line". I sent a message to Canon, they told me to set permissions for "Everyone" to Read & Write on the Library folder. I tried this for:
    /Macintosh HD/Library/Printers/Canon
    and all enclosed items. Still doesn't work.
    Has anyone else set up the MX860 to print from multiple accounts on a computer? Did you have to do anything beyond the procedure specified by Canon?
    Thanks!
    Matt

    Hello Matt,
    I don't understand why Canon support would have got you to change permissions on the Canon folder. This is not normally required.
    I have the MP980 connected via wireless, and I can print to it from my Admin account and a standard account I made up just to check. What account type do you have set for the missus?
    I also would have thought that the printer off-line message would have had more to do with her account not being able to access the network connection, rather than not being able to access the core Printers folder.
    If using her account, you open the Print Queue and select the Utility icon, and then set the Canon IJ Printer Utility to network, does the MX860 display? And if you select it, can you peform any of the Maintenance functions?
    Also, if you connect the MX860 directly to the Mac via USB, are you able to print to it using her account?
    Pahu

  • Accessing MsSQL Database from ABAP

    Hi Guys,
         I want to connect to an external MsSQL Database running in a window environment from an ABAP Report program where the SAP instance running in a Linux OS with DB2 as a Database. I tried all options suggested in all public forums like maintaining DBCON table entry & placing compatible dll files. I need answers from individuals who have done it in the recent past with this environment not beating bushes.
    Thanks in advance.
    Regards
    Vijaya

    hi,
    see on oss note  Question 4
    Note 555223 - FAQ: Microsoft SQL Server
    Q4: My SAP System runs under Oracle (DB2, SAPDB, ...) and I want to
    exchange data with a non-SAP Microsoft SQL Server directly from ABAP.
    Q4: My SAP System runs under Oracle (DB2, SAPDB, ...) and I want to exchange data with a non-SAP Microsoft SQL Server directly from ABAP. A4: The establishing and use of connections from an R/3 system to another non-SAP database (from the same vendor or not) is called multi-connect and is described in note 178949.
    But you must have a specific application server running on Windows if you want to connect SAP to your Microsoft SQL server with DBCON.
    Rgds
    Edited by: stéphane mouraux on Feb 27, 2010 11:21 PM

Maybe you are looking for

  • Error on server - printing stopped - Very First request to print any report

    vs2010 sp2 CR13 sp1 CR12 developed reports requested in app with no mods I'm getting there but I can't get the very first print request honored regardless of size to print on the very first request but will print when re-requested. A very large detai

  • How can I restore iCal using the calendars on my iPhone

    I recently purchased a new iPhone and decided that this was maybe the time I should sign up for iCloud. What resulted was nothing short of havoc. Duplicate calendars, contacts, reminders, you name it, a giant mess. In the process of getting this all

  • Configuration scenario of file to multiple IDOCs in XI

    I have to configure a scenario of file to multiple IDOCs in XI.       I have XML file in MDM server. And it contains multiple segments. Each Segment is  a combination of DEBMAS and ADRMAS. So in XI configuration I have to separate the mapping for DEB

  • Sales Forecast Scenario - help needed

    Dear Experts I need your help in following forecast scenario: I am have two planning areas, one for actuals and other for planning (The cube structure are similar). The forcast function is written at material and month level in mutiplanning area. I h

  • 2 Question: Check mail on launch/Save Attachments

    Hello all. I have 2 Questions about Mail 2.0.5 in Tiger: 1.Start Checking Mail upon Launch I have set Mail to check for new mail every 5 minutes, but everytime when I first launch Mail, I have to manually click on 'Get Mail' for the 1st email check,