Connection Pooling - how to close properly?? PLEASE HELP!
I am very confused about something and cannot find a clear answer within the Oracle docs or Sun's Java docs. When using connection pooling, you create an OracleConnectionPoolDataSource, obtain a PooledConnection, then a JDBC Connection (this is fine). But when finished, you close the JDBC Connection, but what about the PooledConnection? Do you close this too? Or do you just leave it and let it get garbage collected? Is the implementation smart enough to release/reuse PooledConnections when the underlying JDBC Connection is closed? It seems to me that if you close the PooledConnection too, then how/when does the pooling come into place? How/where are the pool parameters (max num of connections) controlled? Please Help! Thank you!
I have implemented a pooled JDBC connection & driver in a large project. So I know something about this topic.
java.sql.* is only interface, that means this package needs implementation. Under an ordinary circumstance, a Connection is an Client/Server communication, when you call close() method, the communication is really closed, so next time, you should reinstantiate the client/server connection, passing authentication and authorization testing, this is a lot of load to the system; connection pool uses a different mechanism to try to save this load, that is, when you call close() method of Connection, the connection is not really closed, but just set a flag to tell the system this connection is available to others, so next time when you call DriverManager.getConnection(...), the available connection will be returned to the caller, and because this connection has already passed authentication and aothorization, the socker between is available, so the extra load could be saved, in other words, the application could use it immediately.
Check java.sql.Driver interface, you will see boolean acceptsURL(String url) and java.sql.Connection connect(String url, java.util.Properties info) methods, first method is used by DriverManager to judge which JDBC driver should be used according to your connection's url format, then that driver's connect(...) method will be called to return an connection. For pooled connection, when you call connection.close() method, the Connection object is not garbage collected but return a pooled connection manager or repository, so it could be reused by other application.
Hope this helps.
//jdev
Similar Messages
-
i m not able to connect for the wifi which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me
We were able to log in this morning and all is working. You should be able to log in at any point today. Please let us know if you are having any other difficulties.
-
I have ipod touch and somebody tried many many times(22000000) to enter the password and now it is locked how i open it please help me ???
You'll need to connect it to the iTunes library you normally sync it with and restore it. If iTunes asks you for this passcode before it will let you proceed, connect the iPod to iTunes in recovery mode instead using the instructions in this Apple support document.
iOS: Unable to update or restore
B-rock -
My ipad doesnt have airplay how do i activate it where is it my ipad is only a year old iv tried looking everywhere but cant find how to enable it please help
[email protected]The following article(s) may help you.
Troubleshooting AirPlay
Troubleshooting Wi-Fi networks and connections
Recommended Wi-Fi settings
Wifi Diagnostic Software (for Mac users)
You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues. -
my ipod keeps asking me to restore and when i do restore it just restarts and asks me to connect to itunes and starts again.please help its my sons bday and this is his present
Maybe:
Restore loop (being prompted to restore again after a restore successfully completes)
Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please follow Troubleshooting security software issues. .
Next try placing in DFU mode and then restoring.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
Then try restoring on another computer.
Last, make an appointment at the Genius Bar of an Apple store.
Apple Retail Store - Genius Bar -
I installed windows 7 to my macbook pro, but my mousepad does not work in windows 7 and also i can not connect my windows 7 to projector, but i can use my macbook's mouse pad and i can connect my mac to projector,so please help me for windows 7 problem
i try to download now, do you think when i download and install the windows support software, can i fix the problem?
-
Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon
See these previous discussions help.
App Store Updates (but only Updates)...: Apple Support Communities
Apps suddenly don't update: Apple Support Communities -
hello. i have a musical keyboard which is yamaha psr e433 and i want to connect it to my macbook pro. please help me give the name of the connector so i can use it for my band. thank you. your help is much appreciated.
hello. i have a musical keyboard which is yamaha psr e433 and i want to connect it to my macbook pro. please help me give the name of the connector so i can use it for my band. thank you. your help is much appreciated.
-
Getting Error "Apple ID does not have permission to access iTunes Connect" while logging to iTunes. Please help me in this regard
Regards,
AmarSee the "More Like This" section over there ===============>
In the future, search before posting. -
I keep receiving this message when trying to connect to facebook on my iPhone "could not connect to facebook - unable to connect to facebook. Please check your internet connection and try again" Could someone please help me?
I was unable to connect to internet via any app. I have now turned my phone off and on again and all seems fine.
Thanks for your help. -
Internet works, but I have an exclamation mark instead of AirPort connection and cannot connect to my WiFi.. PLEASE HELP!
When you see an exclamation point in the Wi-Fi menu, from the menu bar, select
▹ System Preferences... ▹ Network
Click the Assist me button and select Assistant. Follow the prompts. You may get a warning that Wi-Fi is not available, that you're too far from the base station, or that you're using the wrong password.
Assuming that you've ruled out those possibilities, restart the computer and try again. If there's no change, click the lock icon in the lower left corner of the preference pane and authenticate, if necessary. From the Location menu at the top of the window, select Edit Locations. A sheet will drop down. Click the plus-sign button to create a new location. Give it any name you want. In the new location, set up the Wi-Fi service with the same settings you used before. Click Applyand test.
If there's still no connection, and if you have control of the router, compare its settings to Apple's recommendations. Some third-party routers may be incompatible in 802.11b/g/n radio mode. Try setting the mode to 802.11n only. -
Reminders Notifications in Mountain Lion latest update keeps freezing on my homescreen and won't go away when trying to close. Please help.
I'm using a 2009 Macbook Pro and have installed the lastest update 10.8.1I've been seeing this for some time now and getting quite sick of it. It happens when I've been away at work for the day and come home to find frozen notifications.
You can fix this temporarily by quitting Notification Centre from Activity Monitor but it keeps happening to me every week or so. -
i want to upgrade my iphone to 7 ios is it possible ? if it how can i do ,please help me !
Which iPhone do you have and what version is it currently running?
-
My Macbook is slow and the icons bounce 12-20 times before opening and the battery shows 98% when i should show 100% i forgot how to reset it please help thank you
Reset SMC
-
hello,i have a macbook pro and i just recently downloaded facetime, and now i cant use it, it says An internal FaceTime error occurred,i dont know how to fix it, please help.
If your webcam is powered by USB, make sure it is attached directly to your Mac and not a USB hub. In my case, I had my Rocketfish webcam attached to a peripheral USB hub and it wasn't drawing enough power to operate at capacity. Therefore, Facetime was quitting on me and giving me that exact error message. Once I attached the webcam directly to my Mac USB port, problem solved. Hope that helps.
Maybe you are looking for
-
How to create new page in SAP Script?
Moved to correct forum by moderator. Duplicate deleted. Do NOT post the same question in two forums. Hello friends, I am modifying one SAP script. It is already contains 2 pages. FIRST and NEXT. All I have to do is to create one more page which sho
-
How to optimize GUI_DOWNLOAD function I am using...
Hi, I have got 54 internal tables populated at the end of the report. I am using GUI_DOWNLOAD Function to download the data in flat files each corresponding to one internal table. Now in GUI_DOWNLOAD Function, I know I have to mention name of file an
-
Hello folks, I have upgraded iTunes to 10.6 and planned to use home sharing but as soon as I authorise my PC and authorise iTunes By logging by apple id. Home sharing option simply goes away. Just like a blip and it's gone... OS: XP
-
Time code written in the audiotrack
Dear users, i have FCP and i am going to work with the camere van Silicon Image. the SI2K. this one has no timecode reading of 25. european standard, it only has american standards. so now we thought lets write the timecode in the audio track. this r
-
I assume there's no way of creating a apps folder icon on the dock?? i keep trying to drag the apps icon onto the dock but alas...