Having multiple environments open in the same thread.

Dear Sir,
I have a question about the concurrency model inside the bdbje. I read the documents and faqs and wrote some simple
programs using it.
Here is my question, from my understanding, one can open an environment in multiple processes assuming that only
one of the environments is opened for writing. I would like to know how can I open one read environment
and one write environment in the same process. Since in my application, reads and writes can be initiated from
multiple processes [assuming that always having at most one writer]. In my tests when a process receives
a read requests it creates an environment for reading, and if during the reading process the process receives
a write request, it create a new environment to handle the write request. This simple thing throws the following exception:
je.env.isReadOnly is set to false in the config parameter which is incompatible with the value of true in the underlying environment
It seems like I can't have multiple environments with different configurations open at the same time in the same process, i would like
to know if this is really the case, are there any option that I can tweak to fix this.
Thanks,
AliS

hello,
An immutable property of an Environment can not be changed
at runtime. The ReadOnly property for an environment is one of
the few immutable environment properties. Hence, the IllegalArgumentException
was thrown when your application tried to open an environment handle as
ReadWrite when a handle had already been opened ReadOnly. All environment
handles opened by a single process must have the same value for immutable
properties.
You can find some additional information is at:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/index.html
under: EnvironmentConfig
thanks,
Sandra

Similar Messages

  • Having multiple resultsets open at the same time

    Hi,
    I have the following piece of code to populate multiple resultsets returned by a call to a stored procedure in Sybase.
    int l_noOfResultSetsReturned = 0;
    int l_nextResultSetToPopulate = 1;
    boolean l_isResultSet = l_CallableStatement.execute();
            while( l_isResultSet )
                switch ( l_nextResultSetToPopulate )
                    case 1:
                        l_reportListResultSet =  l_CallableStatement.getResultSet();
                        break;
                    case 2:
                        l_inputSetterResultSet = l_CallableStatement.getResultSet();
                        break;
                    case 3:
                        l_outputGetterResultSet = l_CallableStatement.getResultSet();
                        break;
                    case 4:
                        l_outputColumnHeaderResultSet = l_CallableStatement.getResultSet();
                        break;                     
                    default:
                        //throw new CubeInvalidNumberOfResultSetsException();
                        System.out.println(" More than 4 RS returned");
                l_noOfResultSetsReturned++;
                l_nextResultSetToPopulate++;
                l_isResultSet = l_CallableStatement.getMoreResults(PreparedStatement.KEEP_CURRENT_RESULT);
            }The problem is that when I try to run this, I get the following error:
    java.lang.AbstractMethodError: com.sybase.jdbc.SybCallableStatement.getMoreResults(I)Z
    I am using NetBeans 3.6 as the IDE with the java version 1.4.2_06. I got this error when I tried using jconnect45.jar for the driver part. I also tried the same with jconn2.jar. It also gave me the same error.
    I need someway to ensure that the four resultsets are open for further down the line processing. Any help would be most welcome.
    Thanks and regards,
    Ganesh

    I think the AbstractMethod Error is caused by calling a method which is not available on your JDBC Driver. This means you are using a JDBC 3 method on a JDBC 2 driver (or JDBC 2 on JDBC 1 driver). Check the JDBC version of your driver and use only the methods allowed for the JDBC driver version you have (or get a newer one).
    Good Luck!

  • Does anyone have experience with having multiple editors work on the same project from different computers?

    Does anyone have experience with having multiple editors work on the same project from different computers?

    As much as I hate to admit it, YOU ARE RIGHT!
    I will tread lightly on this project.
    Thanks for the sanity check,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Multiple JSP's accessing the same thread

    I have multiple users calling multiple JSP's. I also now want to add in a connection pool, which is implemented as a Runnable (It's a thread). However, how do I set it up so that all of the JSP's get a reference to the same connection pool?
    I have done this in a Servlet, where I could have the connection pool constructed in the init() function, and then the Servlet kept a static reference to the pool. Then for each request, I pass the reference to the pool into the service() function of my supporting classes.
    How can I do this in JSP?

    There are few things.......
    I do not know which application server you are using , but almost all competitive application server provide the concept of connection pooling. You do not have to implement connection pooling yourself. And to get a handle to the connection from the pool is through JNDI namespace(as you do for EJB.)
    Now if you still want to do that yourself then, i can propose one way.
    1) Put a instance of the Java class which holds the connection pooling in the application scope.
    ie useBean= Yourclass scope="application"
    2) Now all the JSP's will be able to get to the same object.
    So Look for documentation for putting objects in different scope ie session, application etc.
    Srinivasan Ranganathan

  • Can ADF keep multiple pages open at the same time?

    My company is currently developing an application to upgrade a client's FORMS system to one based on ADF. One of our client's biggest complaints with the new technology is that he can't work on many tasks at the same time, because our application can't work with "tabs" or "different windows", like Forms can with the "open form ()" function.
    Currently, we use a page called "main.jspx" with the main menu and a region under it, where we load all the "jsff" pages, which do all the different tasks in their systems (like autorizeBuyOrder.jsff, createNewOrder.jsff, etc...).
    Right now, I can only have one "jsff" page loaded on the region at once, and I wanted to make my application able to load and keep track of as many as the user wants. I was thinking on something like a tabs system, or multiple windows system. Does ADF provide any elegant way to do this? Any material you can recommend me?
    Much appreciated,
    Daniel

    Daniel Kaiser wrote:
    Hm, yes, this looks like it could be a possible solution for my problem. I'm gonna try to apply this to my app and get back to you. Thanks for the helpful answer!If you will have any questions on the application of the UI Shell template, then it is better to ask they here
    ADF UI Patterns & Best Practices

  • Can't have multiple videos open at the same time?

    I often start buffering another video when one is finished, so I usually tend to have 3-4 videos open at times. However, about a week ago, the adobe flash plugin would crash. So, I followed this guide:
    http://support.mozilla.com/en-US/kb/The+Adobe+Flash+plugin+has+crashed?style_mode=inproduct
    I also disabled the plugin container. Now, the plugin stops crashing, but firefox stops responding whenever I open a third video. Then, firefox itself crashes. Please help!
    == This happened ==
    Every time Firefox opened
    == About a week ago.

    The same thing just happened when I opened a second video instead of a third one.

  • Fox4 says that it PREVENTs the user from having two tabs open to the same URL. There are times when I WANT multiple open tabs! Can I override this? (Please tell me. If I can't, then I don't want Fox4. I'll stick with 3.x and NoScript.) Thanks.

    Tell me EXACTLY how to FORCE Fox4 to allow me to have MORE THAN ONE tab open to any given web page.
    Otherwise, I have to stick with Fox3.
    Precise details, please. Thanks.

    # Open a new tab - Ctrl + t
    # Start typing the URL in the awesome bar. The page should displayed in the list below with "Swtich to Tab" written under it
    # Scroll down to the URL in the list using the down arrow key and hit Alt + Enter.
    The webpage is opened a second time instead of simply switching to it. Simple.

  • [SOLVED] Having multiple DEs installed at the same time

    Hi
    I'm currently using KDE but I would like to try other DEs like KDEmod and XFCE. How can install and try these DEs without removing KDE?
    Last edited by paldepind (2010-03-18 16:30:19)

    You don't have to remove any DE/WM to use another. You simply have to start the one that you wish to use. Normally this is done either through the ~/.xinitrc script (by adding the neccesary line for the DE/WM you wish to use and commenting out the rest) or manually by running "xinit /usr/bin/startkde" or something along those lines.
    If you wish to use Fluxbox, Openbox or any such WM it is quite possible to run them without a DE (by running, say, openbox-session through your .xinitrc) but you will most likely have to tailor the "desktop" experience on your own. For example Openbox comes with no file manager, no taskbar/tray, it doesn't even support wallpapers on it's own. But you can choose your own utilities for such tasks rather easily.
    All of this is thouroghly explained in their respective Arch Wiki pages so just read up and have fun.
    Last edited by DeVelox (2010-03-17 20:45:50)

  • Multiple Portal instances on the same machine

    Hi  Forum,
    we have a requirement where in we are asked to implement multiple instances of Portal on the same machine. can you please give me some detials on Feasibility , issues and limitations of having multiple Portal instances on the same machine , different instances pointing to different tiers(Dev, Test, Production) etc
    pointers will be highly appreciated..
    regards,
    uday

    Hi Uday,
       Please look at this.
    Multiple Portal Instances - Virtual Hosting
    Regards,
    Siva
    P.S: Award points if you find this useful.

  • How do I open multiple Firefox home pages? I want all of my different Firefox email accounts open at the same time. I recently upgraded to Win7 and now I have to close and open Firefox to access another email acount!

    I want 3 separate, distinct Firefox home pages for each of my 3 email accounts to be open at the same time.

    Questions are typically followed by a question mark. My answer answered your question.
    Firefox doesn't do email, so there are no "Firefox email accounts". If you are accessing "email" with Firefox, you are using web mail. Some web mail services don't allow for direct access, they want their users to access their email from a "portal" or "main" page and will re-direct any attempt to load an "internal" web site page back to the main page.
    As far as loading 3 different web mail accounts at the same time, if they are in the same domain it won't work on Firefox without a Firefox addon. http://br.mozdev.org/multifox/
    IOW, if those three email accounts all with Yahoo, without that add-on you would have to logon to each email account separately and log out of the first before logging into the 2nd. Then log out of the 2nd before logging into the 3rd. Firefox isn't capable of having multiple session cookies for simultaneous logon's to the same server. That add-on provides that "multiple sessions cookies" feature.

  • I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps.

    I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps. Old apple operating systems made it easy to have several folders open at one time. 

    Eric, thanks that works but seems like an extra added step also to do it that way.  I've got to move and organize a ton of files and I'm looking for a easy way to get this done.  I could also open the folder into a separate tab and then drag the tab out so it becomes an open window but thats a lot of fussing around also with extra steps.  Not sure why these newer operating system seems more confusing and less user friendly than what they used to.  In the past I could just click on any folder and it would open in a separate window making it really easy to copy or move files from one place to the other just by simply dragging them from one window to the other.  Seems like I'm going through several extra steps now to do a simple task. 

  • Is it possible to have 2 profiles open at the same time? instead of having to open and close firefox everytime you want to switch.

    I have several profiles and was wondering if it is possible to have more then one open at the same time? At the moment I am having to close the current firefox browser to open up a different profile.

    See these support articles. <br />
    http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox
    http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile

  • How can I make multiple PDF links open in the same second tab, instead of a 3rd, 4th etc.

    I am working on a project for my Universities 125 year anniversary.  Essentially I've created a 125 year long digital yearbook, with a link to the University's actual digital yearbook for each individual year.  I'm wondering if there is a way that I can make all of the yearbook links open in the same second page.
    IE:  Main Project open in a window,  when I click the 1939 Yearbook pdf hyperlink, the 1939pdf will open in the second window.  I then want to find a way so that after this, on the main page, I can click the 1940 yearbook pdf link and have the 1940 yearbook load on the second window, replacing the 1939pdf, instead of just opening the 1940pdf on a third new tab/window?
    Note: I have all of the yearbook PDF's online and downloaded, so I can make the hyperlink send you to the site, or do a download style thing. 
    Thank for any help, and if anyone needs further information just ask me!

    Hi
    Please take a look to this thread Re: Can I refresh the browser rather than open a new tab?

  • App Controller 2012 R2, cannot open multiple console windows at the same time

    Hi All
    I have just moved from SCVMM 2012 SP1 and AppController 2012 SP1 to the 2012 R2 versions. In the previous version my users were able login to app controller, select the virtual machine that they wanted to connect to and click on the console button (or right
    click and select console) and this would open in a new tab in IE, they could do this for multiple VM's and could have multiple tabs in IE so that they could switch between them easily.
    However, since the upgrade, they can now open only one console tab. each time they click on a new VM and select console, it will open in the same IE tab. Meaning that switching between console sessions on multiple machines has become a lot harder.
    I've checked all the obvious IE options, and multiple machines/users, so this seems to be a setting in Silverlight or in IIS somewhere that has changed. I've had a good search around (bing/google) but can't find anything. Has anyone got any suggestions
    on how we can get back to the old multiple consoles in there own tab scenario?
    Cheers
    Darren

    Hi Arne411,
    Thank you for sharing the frustration you're experiencing due to this bug.
    There are a few options:
    If you have Premier support you can open a support case and make a Request for Hotfix (RFH). If an RFH is accepted then you may get the fix prior to its public release. This process also helps us to better understand the issue, number of people affected
    and can increase the priority of producing a fix.
    Provide users access to the VMM Administrator Console. As a member of the Application Administrator (Self-service user) role they will have the same capabilities for accessing VMM managed VMs that they do with App Controller.
    Consider moving to the Windows Azure Pack as the web portal. This has the benefit of being HTML based and provides console access through the RDP client.
    Kind Regards
    Richard
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Multiple threads but they are using the same thread ID

    I'm a newbie in Java programming. I have the following codes, please take a look and tell me what wrong with my codes: server side written in Java, client side written in C. Please help me out, thanks for your time.
    Here is my problem: why my server program assigns the same thread ID for both threads???
    .Server side: start server program
    .Client side: set auto startup in /etc/rc.local file in a different machine, so whenever this machine boots up, the client program will start automatically.
    ==> here is the result with 2 clients, why they always come up the same thread ID ????????
    Waiting for client ...
    Server thread 1024 running
    Waiting for client ...
    Server thread 1024 running
    But if I do like this, they all work fine:
    .Server side: start server program
    .Client side: telnet or ssh to each machine, start the client program
    ==> here is the result:
    Waiting for client ...
    Server thread 1024 running
    Waiting for client ...
    Server thread 1025 running
    server.java file:
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.util.Hashtable;
    import java.util.Enumeration;
    import java.util.regex.Pattern;
    import java.util.Date;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class Server extends Frame implements Runnable
    private ServerThread clients[] = new ServerThread[50];
    private ServerSocket server = null;
    private Thread thread = null;
    private int clientCount = 0;
    //some variables over here
    public Server(int port)
    //GUI stuffs here
    //network stuff
    try
    System.out.println("Binding to port " + port + ", please wait ...");
    server = new ServerSocket(port);
    System.out.println("Server started: " + server);
    start();
    catch(IOException ioe)
    System.out.println("Can not bind to port " + port + ": " + ioe.getMessage());
    public boolean action(Event e, Object arg)
    //do something
    return true;
    public synchronized void handle(int ID, String input)
    //do something
    public synchronized void remove(int ID)
    int pos = findClient(ID);
    if (pos >= 0)
    //remove a client
    ServerThread toTerminate = clients[pos];
    System.out.println("Removing client thread " + ID + " at " + pos);
    if (pos < clientCount-1)
    for (int i = pos+1; i < clientCount; i++)
    clients[i-1] = clients;
    clientCount--;
    try
    {  toTerminate.close(); }
    catch(IOException ioe)
    {  System.out.println("Error closing thread: " + ioe); }
    toTerminate.stop();
    private void addThread(Socket socket)
    if (clientCount < clients.length)
    clients[clientCount] = new ServerThread(this, socket);
    try
    clients[clientCount].open();
    clients[clientCount].start();
    clientCount++;
    catch(IOException ioe)
    System.out.println("Error opening thread: " + ioe);
    else
    System.out.println("Client refused: maximum " + clients.length + " reached.");
    public void run()
    while (thread != null)
    try
    {       System.out.println("Waiting for a client ...");
    addThread(server.accept());
    catch(IOException ioe)
    System.out.println("Server accept error: " + ioe); stop();
    public void start()
    if(thread == null)
    thread = new Thread(this);
    thread.start();
    public void stop()
    if(thread != null)
    thread.stop();
    thread = null;
    private int findClient(int ID)
    for (int i = 0; i < clientCount; i++)
    if (clients[i].getID() == ID)
    return i;
    return -1;
    public static void main(String args[])
    Frame server = new Server(1500);
    server.setSize(650,400);
    server.setLocation(100,100);
    server.setVisible(true);
    ServerThread.java file
    import java.net.*;
    import java.io.*;
    import java.lang.*;
    public class ServerThread extends Thread
    private Server server = null;
    private Socket socket = null;
    private int ID = -1;
    InputStreamReader objInStreamReader = null;
    BufferedReader objInBuffer = null;
    PrintWriter objOutStream = null;
    public ServerThread(Server server, Socket socket)
    super();
    server = _server;
    socket = _socket;
    ID = socket.getPort();
    public void send(String msg)
    objOutStream.write(msg);
    objOutStream.flush();
    public int getID()
    return ID;
    public void run()
    System.out.println("Server thread " + ID + " running");
    while(true)
    try{
    server.handle(ID,objInBuffer.readLine());
    catch(IOException ioe)
    System.out.println(ID + "Error reading: " + ioe.getMessage());
    //remove a thread ID
    server.remove(ID);
    stop();
    public void open() throws IOException
    //---Set up streams---
    objInStreamReader = new InputStreamReader(socket.getInputStream());
    objInBuffer = new BufferedReader(objInStreamReader);
    objOutStream = new PrintWriter(socket.getOutputStream(), true);
    public void close() throws IOException
    if(socket != null) socket.close();
    if(objInStreamReader != null) objInStreamReader.close();
    if(objOutStream !=null) objOutStream.close();
    if(objInBuffer !=null) objInBuffer.close();
    And client.c file
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <netdb.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <unistd.h> /* close */
    #include <time.h>
    #define SERVER_PORT 1500
    #define MAX_MSG 100
    //global variables
    long lines = 0;
    int sd = 0;
    char command[100];
    time_t t1,t2;
    double timetest = 0.00;
    int main (int argc, char *argv[])
    int rc, i = 0, j = 0;
    struct sockaddr_in localAddr, servAddr;
    struct hostent *h;
    char buf[100];
    FILE *fp;
    h = gethostbyname(argv[1]);
    if(h==NULL) {
    printf("unknown host '%s'\n",argv[1]);
    exit(1);
    servAddr.sin_family = h->h_addrtype;
    memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
    servAddr.sin_port = htons(SERVER_PORT);
    /* create socket */
    sd = socket(AF_INET, SOCK_STREAM, 0);
    if(sd<0) {
    perror("cannot open socket ");
    exit(1);
    /* bind any port number */
    localAddr.sin_family = AF_INET;
    localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    localAddr.sin_port = htons(0);
    rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr));
    if(rc<0) {
    printf("%s: cannot bind port TCP %u\n",argv[1],SERVER_PORT);
    perror("error ");
    exit(1);
    /* connect to server */
    rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));
    if(rc<0) {
    perror("cannot connect ");
    exit(1);
    //send register message
    rc = send(sd, "register\n", strlen("register\n"), 0);
    //if can't send
    if(rc < 0)
    close(sd);
    exit(1);
    //wait here until get the flag from server
    while(1)
    buf[0] = '\0';
    rc = recv(sd,buf,MAX_MSG-1,0);
    if(rc < 0)
    perror("receive error\n");
    close(sd);
    exit(1);
    buf[rc] = '\0';
    if(strcmp(buf,"autoplay")==0)
    //do something here
    else if(strcmp(buf,"exit")==0)
    printf("exiting now ....\n");
    close(sd);
    exit(1);
    return 0;

    Yes......I do so all the time.

Maybe you are looking for

  • SAP GUI 6.20 - 6.40

    Hi I have a question regarding tha SAP Gui versions. We are planning to upgrade the R/3 system to mySAP ERP 2004 starting next month. This R/3 version requires GUI 6.40. We would however continue using BW 3.1 for some time. I tried to install the 6.4

  • How can I get the Date & Time to appear on my final project in iMovie11?

    I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear.  How can I get the Date  & Time data to appear on the f

  • How to add osd file into app-v package - need to have two osd files within one app-v package

    We have app-v 4.6 sp2 I get one app-v existing package which has two OSD files associated. It is needed for separate license servers located in different sites. I need to create a new app-v package with new version of this application and want to hav

  • Java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path

    hi, i am trying to connect to an oracle 8.1.7 database from my application running on tomcat 4.0.3 / jdk1.4 /windows nt. using the thin jdbc-driver (classes12.zip) everything works fine. when i try using the oci8-driver, i get an error-message saying

  • User entered format not retained when using BAPI_CLAIM_CREATE

    The notification text entered by the end user from a portal login is sent in  (tables: notif_text  of BAPI_CLAIM_CREATE)  and when retrieved later there are unexpected extra spaces or condensing of space or paragraph formatting is messed up. I have t