Multiple users, closed connections

Hi,
I have been building this web application for some time now, and it's going through testing right now. This project has pretty much been a foray into the world of Java/JSP/JDBC/JNDI/etc, considering I've been learning as I go. But - the second the test group actually started using the application, they got random errors. According to the logs, connection closed errors.
The scenario looks something like this (according to the logs):
Client A opens a page
Client B opens a page
Client B finishes faster and connection closes
Client A gets SQLException: Connection is closed.
It's as if there is only one connection (..is there? Truth be told, I'm not exactly sure). I was thinking that it may be a race condition, something to do with threads (although I don't use threads myself, I was just guessing Tomcat might have something to do with this) or something to do with Tomcat's cache, but it's hard to start poking around without knowing what I should poke. I'm betting my money on the all-time favourite - PEBKAC.
Anyway, the application has a "base" JSP, which in turn loads other classes if necessary.
The JSP contains:
/* 8< 8< 8< 8< 8< 8< */
db=new DBconnection("jdbc/mydb");
/* 8< 8< 8< 8< 8< 8< */
db.Close();Configuration file:
<Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/mydb">
</ResourceParams>
/* 8< 8< 8< 8< 8< 8< */
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/mydb?autoReconnect=true</value >
</parameter>The DBconnection class outline:
public final class DBconnection {
  private Connection con;
  public DBconnection(String resource) {
    this.con=null;
    try {
      Context initContext = new InitialContext();
      Context envContext = (Context)initContext.lookup("java:/comp/env");
      DataSource ds = (DataSource)envContext.lookup(resource);
      this.con = ds.getConnection();                
    catch(SQLException ex) { /* blahblah */ }
    catch(Exception ex) { /* blahblah */ }
    if (this.con==null) { /* blahblah */ }
  /* Update, Query and other methods */
  public void Close() {
    if (this.con!=null) {
      try { this.con.close(); }
      catch(Exception ex) { /* blahblah */ }
}I tried searching Google and this forum, but I couldn't find anything close to this. I greatly appreciate any advice.

Hi, thanks for the reply.
I don't know what the MVC model is, since I am new to JSP and servlets. I do not use servlets as such,
although I believe that the 'snippets' of java code used within the JSP pages are known as Java servlets?
Due to the fact that i only use JSP, this would mean that I can't extend servlets from a controller
servlet. I would be able to implement your idea in Java, but I'm not sure about JSP. Sorry if I am
missing your point, perhaps I misunderstood. Could I have a controller JSP file which accesses the
database using abstract methods, and then passes the results back to the other JSP files??
If you require I can give you more details on my implementation.
Thanks again for the prompt reply,
Craig.

Similar Messages

  • WRT160n v3 has slow connection when multiple users are connected

    As of last night my router has been producing slow connectivity when multiple users are connected to it, but it's perfectly fine when only one user is connected.
    I am on a laptop myself, but we also have a second laptop and a desktop where the modem and router are set up.
    I have upgraded the firmware so that is up to date.
    We have Comcast Fiber Optics so my internet speed is normally quite fast even when all of my computers are connected.
    Some settings that I have that might help resolve the issue:
    I am using DHCP Configuration.
    My Channel Width is set to 20 MHz and I am using Channel 11.
    The Security Mode is set to WPA Personal. I had it on WPA2 Personal but I read that changing to WPA Personal might help and so far it doesn't seem to have done anything.
    I set the Beacon Interval to 50, Fragmentation Threshold to 2304, and RTS Threshold to 2304.
    Everything else is set to the default factory configuration.
    Just today I received a notice that said "Windows has detected an IP Address Conflict", but ever since I reinstalled the Firmware it hasn't come back. I've rebooted both my laptop and the desktop to confirm it hasn't come back as well.
    I consider myself to be computer savy, but I just can't figure out what the problem is as I've tried everything that I could think of including reconfiguring my router and restarting my modem as well. This problem has presented itself in the past before but unfortunately I cannot remember what I did to fix it.

    Try using inSSIDer to help you find the best channel.
    http://www.metageek.net/products/inssider/
    If that doesn't help, you can try disabling WMM.
    Edit:  You should use WPA2 AES security for best performance.

  • Is there a way for multiple users to connect to my home sharing with their iOS device to select music to stream to my A/V receiver jukebox style?

    I have an A/V receiver that I can connect to and select music to stream over my network but I want to know if I have a party if it's possible for multiple users to have access on their own devices to my home shared music and select music to play like a jukebox.

    I almost forgot that using folders can allow each folder to contain a song. I also recall touch tracks or one key play...

  • What do I need to do to allow multiple users to connect to a Server?

    Hi,
    What do I need to do to allow more than two people to be able to connect to a server via RDP?
    I am using Server 2012 and I need 4 clients to be able to RDP in.
    The clients will only be accessing the Server from our internal network while they are onsite.
    Do I have to setup Licensing and what other steps do I need to do?
    Thanks   

    Hi,
    Thank you for posting in Windows Server Forum.
    Yeah, agree with words of Hari. Normally by default server will allow only 2 remote connection for administrator purpose. So you want 4 users to connect you need RDS CAL to access it. As already suggested you can purchase RDS CAL (Per User or Per Device) according
    to your requirement. 
    After installing RD License server you need to activate it first and then you can install the purchased RDS CAL.
    More information:
    Enabling more Remote Desktop Connections in Windows 2012
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/cf93b596-413b-4390-a452-acb19a4b0b14/enabling-more-remote-desktop-connections-in-windows-2012?forum=winserverTS
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • Mac Mini Server - Best Way to Enable Multiple Users to Connect via Remote Access Concurrently?

    Hi
    Is there a limit on the number of users that can connect simultaneously via remote access to a Mac Mini running Mac Mini Server?

    If you have the server application on your Mac mini there is an upper limit but it is so high that I wouldn't worry about it. Depending on how you will be using the server and what it will be supporting there is a practical limit based on performance not software. If you reach the limit of satisfactory performance, the solution is adding another Mac mini server.

  • Solution Needed: Using VPN as a Jump off for multiple users to connect outbound to multiple 3rd party VPN

    I work for a healthcare consulting company, we have 50+ consultants that work remotely from their home.  We currently are cloud managed and for various reasons are looking for a solution to streamline our connection to our Clinics' personal VPNs.  Our Clinics' VPNs vary greatly in regards to vendor and type of connection. 
    What we want to do:
    Create a Jumpoff where all our consultants (simultaneously as well) can remote VPN into. From there be able to jump out to any of our Clinics' VPNs. 
    We need this because we have some consultants with foreign IPs and we also want to connect from Google Chromebooks which don't play nice with every type of our Clinics' VPNs.  So the our Jump Off Box will have all the needed connections for any type of VPNs our Clinics use. 
    This solution should connect to our Clinics' side from their default VPN settings - Just a regular VPN connection from us to them. 
    From what I have been told is that this was attempted in the past: 
    Consultants VPN'd to our cloud server - RDPd to a machine and then VPNd out to our clinics. However this locked down the VPN and only one consultant could jump out. 
    What Cisco Product would allow us to do so?
    How would this be set up? 
    Do we set up the Router to handle outbound connections?
    Any input would be greatly appreciated.  

    Hi Jay, there are a number of ways you can do this I can help you setup an initial recommendation on what products to get please send me an email at [email protected] hope to hear from you soon!

  • Multiple User with different Password

    Hii
    I am looking for a router which has the best range and allow multiple users to connect to the router using their own different passwords, and further it may allow the admin to manage the Bandwidth and data of each user.

    Hi, dxtariq. What I know is that Linksys routers can allow you to create three (3) different passwords. This is applicable if the wireless router you have is a dual band. This means, you can create each 5Ghz and 2.4Ghz wireless name and password plus there's an additional connection to the guest. You can create a different password for your guest access.  To learn more about Linksys you may also visit their site: support.linksys.com

  • Multiple Users - Concurrent Software Development on X Server

    How can I setup the X Server to allow for multiple users to connect and concurrently do development activity (use iPhone SDK for developing applications) activities?

    Oké, I will give it a try.
    X server, you mean MacosX server or really X server?
    However this hangs to development, I guess you should ask this in the unix forum.
    I do use MacosX server, but actually, don't `need` it for the development itself. You can use it for sharing of documents with afp smb etc, but you can do that with a client too. If people are outside of your LAN, then set up a VPN.
    Keep control who may logon and then they work as if it was local.
    I did use VPN, but for now I did turn it off. Did mess up with a few things. :-/
    What I still do,
    Docs like UML, tech docs, images, which all are project in-depended and taken from the web or from a third party, I share those via AFP.
    Project independed documents, drawing etc, and documents that a project member or I did wrote are checked in by the writer at a svn server, and are semi automatic checked out to the afp share.
    Project depended documents, drawing etc, and documents that a project member or I did wrote are checked in by the writer at a svn server, and can be checked out locally at will of the developer.
    The same with the xCode personal setting, found at
    /Users/<developer>/Library/Application Support/Developer/Shared/...
    and
    /Users/<developer>/Library/Application Support/Developer/3.2/...
    /Users/<developer>/Library/Application Support/Developer/3.1/...
    ( I use the later ones on when I am not sure if my templates or whatever is not versions wide compatible ). They are accepted by xcode.
    I will ( still busy with that ) sync parts of that with the server, but I use a sync application for that. Still no need for macosx server.
    But like the scripts.plist, it dangerous to just sync that file, when more people add scripts on that file between syncs.
    So because macosx client can do afp shares and you need a svn server ( I use Subversion ), it is no demand to have a macosX server.
    If you want to do timesharing for compiling than just install a xcode on your 'server' and leave it running and set the setting under the 'distribution build' tab in the xcode preferences. I did use this only one time, so no real experience.
    At the beginning it is hard to manage, but after a period when things get settled it good to be there.
    HTH
    If you mean something differently then someone else can fill in. and am also curious how other people or groups are doing this.
    For the specific things like VPN, I guess you have to loo at the unix or networking forum

  • How can I have multiple users on iTunes (in order to connect to a shared office iPad)?

    How can I have multiple users on iTunes (in order to connect to a shared office iPad)? Currently each of us has our own iTunes account, so I've made an "all office" Apple ID. However, I can't seem to get two different accounts (my personal and the office) to work on my machine. Even when I login as "the office", my personal library is still showing. Additionally, when I try to setup with a first-time use in iTunes, I get an error that I don't meet the minimum age requirement - no matter what birthdate I enter!

    The library exists regardless of which user is logged in.
    The only way around that is to create different user accounts on the computer.
    There is no way to have 20 unique iTunes users access a shared iTunes under a single login on the computer.

  • HT2688 Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared librar

    Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared library?

    Was your wife logged into the libray at the time you tried to log in? I have had a similar problem and it was because another user was logged into the library when I attempted to. I got the permission denied banner.

  • How to provide access to multiple users connected to a Dumb switch? (multi-auth/multi-domain)

    Good morning everybody,
    I am writing on behalf of not being able to implement a desired outcome in our company network. In fact the situation is as follows:
    What I want to do is to be able to authenticate users (802.1x authentication) in our company radius server and authorize them access by having a dynamic VLAN assignment in a multi-user environment on one and the same port of a Cisco 2960 switch. So far, the authentication and authorization has been working completely smoothly (there are no problems with itself). The concept involves the configuration of both DATA and VOICE VLANs as I there is also phone authentication implemented. In order to simulate this environment I introduce a Dumb switch connected to my Cisco 2960 Catalyst.
    What I have successfully managed to get to work so far is this:
    1) On one switch port I have tried the “authentication host-mode multi-domain” and it worked perfectly for a PC behind a telephone, or with one PC connected to a the dumb switch + the telephone connected to another port of the dumb switch. Logically it is the same situation as there is a separation in two domains – DATA and VOICE. Bellow is an output from show authentication sessions for this scenario.
    Interface  MAC Address     Method   Domain   Status         Session ID          
    Fa0/23     0021.9b62.b79b  dot1x    DATA     Authz Success  C0A8FF69000000F3008E (user1)
    Fa0/23     0015.655c.b912  dot1x    VOICE    Authz Success  C0A8FF69000000F9009F (phone)
    2) On the other hand, when I try the same scenario with the “authentication host-mode multi-auth”, the switch still separates the traffic in two domains and is able to authenticate all users, AS LONG AS they are in the same VLAN.
    show authentication sessions:
    Interface  MAC Address     Method   Domain   Status         Session ID          
    Fa0/23     0021.9b62.b79b  dot1x    DATA     Authz Success  C0A8FF69000000F3008E (user1)
    Fa0/23     b888.e3eb.ebac   dot1x    DATA     Authz Success  C0A8FF69000000F8008C (user2)
    Fa0/23     0015.655c.b912  dot1x    VOICE    Authz Success  C0A8FF69000000F9009F (phone)
    However, I cannot succeed authentication of many users from DIFFERENT VLANs, neither in multi-auth nor in multi-domain modes.
    What I want to get is an output like this:
    Interface  MAC Address     Method   Domain   Status         Session ID          
    Fa0/23     0021.9b62.b79b  dot1x    DATA     Authz Success  C0A8FF69000000F3008E (user1)
    Fa0/23     b888.e3eb.ebac dot1x    DATA     Authz Success  C0A8FF69000000F8008C (user2)
    Fa0/23     0015.655c.b912  dot1x    VOICE    Authz Success  C0A8FF69000000F9009F (phone)
    I want the switch to authenticate the users anytime they connect to itself and for them to have an instant access to the network. (I tell this because I tried scenario 1) with multi-domain mode and authentication violation replace, and it worked but, two users never had access to the “Internet” simultaneously!!!
    The configuration of the interface connected to the Dumb switch is as follows.
    interface FastEthernet0/x                                                      
     description Connection to DUMBswitch                                            
     switchport mode access                                                         
     switchport voice vlan XXX                                                      
     switchport port-security maximum 10                                            
     switchport port-security                                                       
     switchport port-security violation protect                                     
     authentication host-mode multi-auth                                            
     authentication priority dot1x                                                  
     authentication port-control auto                                               
     authentication timer reauthenticate 4000                                       
     authentication violation replace                                               
     dot1x pae authenticator                                                        
     dot1x timeout tx-period 10                                                     
     spanning-tree portfast                                                         
    The way I see it is explained in the following steps:
    - PC1 connects to the Dumb switch. This causes the Cisco switch to authenticate user1. This creates an auth. session with its MAC address linked to a domain DATA.
    - When PC2 connects to the Dumb switch, this causes the violation replace which replaces the recent authenticated MAC address with the MAC of PC2. I would like it once authenticated to appear in the authentication sessions with a link to a new DATA domain linked to the VLAN assigned from the RADIUS server.
    Is this possible? I think (in theory) this is the only way to provide authenticated access to multiple users connecting through Dumb switch to the network.
    Has anybody ever succeeded in such a configuration example and if yes, I would be love to get some help in doing so?
    Thank you
    Stoimen Hristov

    Hi Stoimen,
    I have done a setup similar to yours with the only exception being VLAN assignment. When I used dACLs only, it makes things somewhat easier as the VLAN no longer matters. Remember that the switchport is in access mode and will only allow a single VLAN across it (with the exception of the voice VLAN). I think that is the real cause of your problem.
    From what I can see, you have 2 options available to you:
    1) Use dACLs instead of VLAN assignment. This means that an access list will be downloaded from the radius server straight to the authenticated user's session. I have tested this and it works perfectly. Just Google Cisco IBNS quick reference guide and look for the section that deals with Low Impact mode.
    2) Get rid of the dumb switches and use managed switches throughout your network. Dumb switches will always be a point of weakness in your network because they have no intelligence to do advanced security features like port security, 802.1x, DHCP snooping, etc.
    Hopefully someone else will chime in with another option.
    Xavier

  • Multiple Users Connected to Airport Disk at Same Time

    It used to be that I could have multiple user accounts on my MBP connected at the same time to my AirPort Extreme Base Station (802.11n). Now, every time I switch users, I have to reconnect to the AEBS, which in turn seems to disconnect the other user. File Sharing is set up to allow connections via the AEBS password, which always worked fine in the past.
    I'm not sure what has changed in my setup, other than installing Snow Leopard (which I don't assume changed anything in this regard).
    Any ideas will be most appreciated.

    Sorry no one has answered this question. I have the exact problem. I have two user accounts on my MBP. I selected connecting AEBS via AEBS password, too. I can connect with one account and see everything on the disk. When I switch to the other account, it sees the disk but nothing on it. If I disconnect from the disk in that account and then reconnect to the disk, the second account sees everything on the disk. Switching back to the first account, it now can see nothing on the disk and the disk emblem has an icon on it which indicates no access. Clicking on the disk tells me I have no access privileges for the disk. I can then do the same as I did on the second account - use the disconnect button, reconnect, and then all files appear. Of course, when going back to the second account, can no longer access the information. I can do this all day switching back and forth, disconnecting and reconnecting. Obviously, this is not the way it is suppose to work.
    I am using snow leopard also.
    I have tried setting the disk up by using accounts - created two user accounts and passwords In the Airport Utility application. I can access the disk but nothing shows up on it. I suppose I could have created stuff on it and it would not have been available to the other account. Still, not the way I want to use it. I think I tried using the disk password method also and I think it reacted just like the user account issue or maybe the other---neither will keep both users logged in and have access to whatever is on the disk - which is how I want to use it.
    I add this reply in hopes that someone will read both accounts and give us both an answer. OR, if the original poster now has the answer, please provide!!!
    Troup Nightingale

  • Simulate Multiple users connecting to same session

    Hi All,
    Is there anyway we can simulate multiple users connecting to the same session in oracle using PL/SQL.
    Thanks,
    MK.

    As per the architects in our company, lots of users connect to the same session and access the database.Exactly what does this mean? A single session can service one user at a time. I would wager that the architects are envisioning (or describing) a connection pooling setup where the middle tier server maintains a relatively small number of connections to the database (each with its own session most likely) and users operate by getting a connection from the pool, making a request, and returning the connection back to the pool. At any given point, only one user can be using a connection.
    If that's the case, you would simulate this by simply executing code in a loop in PL/SQL.
    Of course, if this is the case, each connection in the connection pool would its own copy of the collection and so each connection would get its own list of order numbers. You'd have to develop some way to ensure that each session populated its collection with a different set of order numbers.
    Justin

  • How do I connect multiple users to a project on Sharepoint for collaboration

    I have 2 users working in Robohelp 11.  I have uploaded a project to SharePoint 2010 and it seems to funtion fine with version control.  I would like to connect a second user to that same project on SharePoint so the 2 users can collaborate.  However, I don't see any options in Robohelp that allows for a user to connect to an existing project on sharepoint, only to upload a new project.  Please help.
    Thanks,
    Dan

    On the second PC, go to SharePoint and download the entire project. The easiest way is to open the SharePoint library in Windows Explorer.
    Then open the local copy with RoboHelp. That should be all.
    Kind regards,
    Willam

  • How to make Adobe acrobat feature to convert SAP  Pages to PDF available for multiple users connected to the same Citrix server

    Hi,
    In my previous endeavours to solve this business requirement where multiple users will be able to use the Adobe acrobat feature to convert SAP pages inside SAP to PDF, I was told that it is not possible to do this for multiple users at the same time. However I have found an article according to which it says it is possible. Could you check it once and let me know if this article can be used for implementing the requirement stated above as this link clearly indicates that Adobe Acrobat is supported on Citrix.
    Please find the link below where it states it is adobe acrobat is supported in Citrix for multiple users.
    http://www.adobe.com/devnet-docs/acrobatetk/tools/AdminGuide/citrix.html.

    1. What is the Acrobat feature that you mean? There's nothing specific to SAP included with Acrobat.
    2. Yes, some Terminal Server configurations appear supported (check carefully). All users of the terminal server will need a license, so far as I know - total licenses = total individual people using.

Maybe you are looking for