pool 2 « Connection « Java Database Q&A





1. Connection Pool Dirty Connection?    coderanch.com

I'm coming across a problem where an exception is raised after server based connection pool connection has the setAutoCommit(false) method run: psuedo code: import javax.naming.*; import javax.sql.*; import java.sql.*; Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/beer"); Connection connection = ds.getConnection(); connection.setAutoCommit(false); //exception here. 03/Jul/2004:10:15:56] SEVERE ( 8864): RAR5040:Cannot get local connection com.sun.enterprise.resource.PoolingException: I/O Error: Got minus one from a ...

2. database connection pooling confusion    coderanch.com

We think we're having problems with our db vendor's ODBC driver (smaller player, not Oracle or Microsoft or MySQL), and while we're waiting for them to scout out problems on their end, we're trying to see if there's any code we can tweak in our J2EE web app. I'm trying to understand some of the connection pooling code written by a ...

3. Desktop App and Connection Pools    coderanch.com

4. Connection Pool    coderanch.com

I am looking for something that I don't know if exists or not. I am working on a web app where I will be using a Connection Pool of some sort. Problem is I don't want to write configs for several different app servers. So I was thinking that there might be a Connection Pool project of some sort that works ...

5. Connection pooling implementation    coderanch.com

Hi, I have one more question.. I am Using the Oracle 9i thin driver and developing JSP pages using Oracle HTTP server. In every JSP page, I am including another jsp page (DBConn.jsp) which registers the oracle driver and opens the Connection. After processing the oracle queries, I am closing all resultsets, statements and finally the connection object. So, in every ...

6. Connection Pooling    coderanch.com

7. Connection Pooling    coderanch.com

8. Creating a Connection Pool    coderanch.com

Hi, Jehan! There is a way to do so by opening a connection and then using it and returning it to the pool without closing it. Then you could have many connections sitting in a pool waiting to be used - and less overhead. I would suggest just writing a JavaBean class to accomplish that.

9. connection pooling    coderanch.com

I have following questions about connection pooling --- 1. if the server sets an initial connection number as 10 in the pool, then what if there are 11 requests coming in, each needs a connection ? Certainly the first 10 requests will use the 10 connections in the pool, then how about the 11th request ? When it finds that the ...





10. Help for Connection Pool    coderanch.com

Hello All, I am new here and new to the connection pooling and just trying to learn it. I had been successful in deploying the DataSource as guided http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html and learnt a lot about it!! This is the Connection Pooling provided by the Tomcat 4.0 Application Server. My question is, is there any other method for connection pooling besides provided by ...

11. Connection Pool    coderanch.com

If connection pool is available from App server, then I dont think we should re invent the wheel. If still there is some scenario where we should use own connection pool then I will really welcome. becuase creating connection pool needs lot of consideration otherwise pool can be very nasty to system. thanks

12. How to use Connection Pooling?    coderanch.com

13. connection pooling - sort by most recently used?    coderanch.com

In our web app's connection pool, we recently changed the code that retrieves a connection from the pool for use by the app to sort by least recently used...however, since we regularly try to reap connections (close them--give them back to the database) that haven't been used in a while, wouldn't it make sense that the getConnection() method sort by most ...

14. which connection pooling to use?    coderanch.com

16. a question on connection pooling    coderanch.com

Hi! I am looking at using Jakarta Common DBCP to manage my database connection. However, I am a bit confused on how to use this. I understand I could setup a data source in Tomcat to achieve the parameter setting. However, I am looking at doing something which is independent of the application server. How can I setup those parameters for ...





17. connection pools    coderanch.com

I am fixing a web application which uses mostly jsp. I am inserting an applet to replace much of the broken function of one specific page. The page makes numerous database calls and, when implemented several people might be on the page at one time (several being maybe a dozen) I had the crazy thought of implementing a connection pool (I ...

18. JDBC Connection Pooling    coderanch.com

Hello, I want to access a db using properties object(connection pooling I think). Is there any one here who could give me an example how to do this? The reason why I want to do this is because the JDBC code should not be tempered with any time some one comes new. One just have to change the logon properties (basically ...

19. how to use connection pool    coderanch.com

20. How to Use Connection Pooling    coderanch.com

21. connection pool    coderanch.com

hi all we are developing one application which will be accessed by 500 concurrent users.so we r created connection pool and datasource using weblogic(we r using weblogic 7.0.5).i placed properties in xml file and everytime iam reading from xml file, the properties are prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); prop.put(Context.PROVIDER_URL,"t3://localhost:7001"); actually iam new to this,is this properties r enough or anything i have to add properties.what ...

22. connection pool    coderanch.com

23. Connection pooling vs using a single connection    coderanch.com

From what I understand: Connection pooling is used primarily to allow for transactions using connection.commit() or connection.rollback() . However, transactions are not always neccisary. If an application doesn't use transactions, could it get away with having a single connection instead of a pool? And, more importantly, are there any major benefits to using that single connection, apart from the relatively slight ...

24. Connection Pooling    coderanch.com

Originally posted by jayant bhoge: I want to know what is connection pooling in JBoss? and how it is used to access SOL and ORACAL database?. Can connection pooling be done throgh coding? Connection pooling is concept to cache the connection rather creating Connection to database everytime you need it.SInce invoking a connection nuumber of times would be costly.In Connection pooling ...

25. Connection pool in cluster environment    coderanch.com

I am still confused. I'll google to learn more about this. In a mean while it would be great if some one could throw more light on this issue. It is better to cache preparedStatement from a cluster connection pool than local app server. What is the relationship between a cluster connection pool and a local app server connection pool?

27. Connection Pooling    coderanch.com

Hi guys, At present we are using a oracle connection pooling in our application. However, we require the functionality to refresh connections after a specified period. Proxool Connection Pooling does this, however it does not meet other requirements, mainly the dynamic scheme defined by oracle. So far Ive looked though c3p0, proxool and jakarta's dbcp. Can anyone recommend any other opensource ...

28. Problem with database connection pooling resin+mysqlw    coderanch.com

Hi, Urgent.. We are facing a problem with database connection pooling in our production setup. Our current setup is: JSP application running on Resin 3.0.12 web server with MySQL 4.0.23 database We have configured database connection pooling as per resin documentation. extracted from resin.conf: jdbc/relMgr jdbc:mysql://localhost:3306/relMgr user1 pwd 8 20 30s Problem description: Randomly the application ...

29. connection pooling in JDBC    coderanch.com

30. Connection pool - running out of connections    coderanch.com

hi, We are using JConnect 5 and JDK 1.5 in our application. We use connection pool to get the connection and close the connection after using it by con.close(). But appraently the connections are not getting closed and we can see lots of DB connections in the syabse server. Due to this we are running out of user connections on syabse ...

31. CommunicationsException and Connection Pooling    coderanch.com

Hello; I have a simple application that requires DB access. During some of it operations it was creating too many connections to the DB. I created a simple connection pooling class. This resolved the problem. The application obtains 10 connections to the DB and never needs any more than that. The problem now is if the application has been used and ...

32. Help With Connection Pool    coderanch.com

Hello; I am trying to get a connection pool running in my application. I get the error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context Not sure what is going on here. Am I not getting a reference to the datasource in the correct way? Have I configured one of the files wrong? Any tips would be awesome. Here is ...

33. Connection pooling & rs.next()    coderanch.com

34. What is Connection Pooling? And how to use It    coderanch.com

Some operations are verrrryyyy slow. Database connections are the usual culprit. Consider an application where you have a buch of short database operation scattered through your application, like 'check user exists', 'get user groups', 'load preferences', 'update list of things', 'check other list for updates' and about a hundred more. You would find that the cost of opening and closing database ...

35. Connection Pooling    coderanch.com

Thanks a lot its working fine now One more doubt I wanna clear is that on mysql server i get the process list as given below Id UserHostdbCommand Time 142root localhost:1531javatestSleep10 I cannot understand why do i get the above process list i.e. in Sleep mode Is it okay or what is the procedure to kill the process or close the ...

36. What is Connection Pooling    coderanch.com

37. what is connection pool    coderanch.com

Connection pool is the group of connection objects.You can implment your own connection pool or can use application servers connection pool.At the start up ,server creates connection pool with connection objects.You can specify pool size. Whenever you make database transaction ,connection object from pool is used.Once your transaction is over object is returned to the pool.

38. recreating damaged connection in pool    coderanch.com

Hi Ranchers, We are using jrun 4.0 connection pool for connecting to oracle 9. Apart from the connection pool, we are externally managing (to allocate the connection to the user) and giving the connection from the pool based on our own logic. After some time of running the application, one/few connections are timedout and returned to the pool as a stale/damaged ...

39. connection pooling    coderanch.com

40. Connection Pool    coderanch.com

She says that in a connection pool connection objects are created on each request. Is that true? Well, it depends on which connection pool implementation she is talking about but generally no. Connections in the connection pool will generally be reused, rather than destroyed and recreated. When you write a piece of code that calls an open method on a connection ...

41. Store Connection Pool    coderanch.com

Im using one example of connection pool. The example have a servlet that I think make the management of the connections in the pool. My problem is to use the servlet itself. Where I store the pool? Actualy im storing the pool in one application variable but at the end of some time with multiple online users I cant get more ...

43. Proper way to use a connection pool    coderanch.com

What is the proper way to use a database connection pool? My understanding is that, when I wish to execute an SQL statement, I should 1) request a Connection from the pool, 2) execute the SQL, and 3) return the Connection to the pool. Some of my fellow developers, however, believe that when a user request is received, a Connection should ...

44. Connection Pool Question    coderanch.com

46. Connection Pool    coderanch.com

47. problem in connection pooling    coderanch.com

Several things could happen, depending on the way the connection pool works or is configured. It could be that the 11th client is put to sleep until one of the other 10 clients releases a connection. It could also be that the 11th client gets an exception that indicates that there are no connections available.

48. connection pooling implementation    coderanch.com

What app server/servlet container are you using? For example, if you are using Tomcat, you usually configure your connection pool there, and it will register it via the JNDI. Are you using an web app framework or data persistence framework/service like Hibernate? Again, it may handle the data source/connection a certain way to make your life a whole lot simpler. If ...

49. Checking Connection Pool Size    coderanch.com

Is there a way I can check the status of the connection pool using JNDI? I'm working on a web application using Tomcat and SQL Server with the JTDS driver and I'm having concerns that I may have some stray connections open or some performance issues that I want to tweak. I'd like to make a JSP/Servlet that I can get ...

50. Connection Pooling Tomact vs. Java based    coderanch.com

I have heard that it is better to do your connection pooling on the server vs in the code is that true? If so how will it benefit me doing on Tomcat. We currently run Tomcat 5.5 and we have a Sybase database here at my company. Any tips that you have would be welcomed. . .. Help plz!!!

51. New Article: JDBC Connection Pooling    coderanch.com

In the section about the life cycle of JDBC connections, there is an example of creating a connection in a servlet's init() method and closing it in the servlet's destroy() method. The following text says "However the database connection is kept open for the entire lifetime of the servlet and that (sic) the database will have to retain an open connection ...

52. connection pooling    coderanch.com

Raghuram, As the name indicates, Connection pooling is just a way to efficiently handle your database connection(JDBC connection) by sharing it for different clients. So when your server starts or when you make the first call to a db, you can make a pool of prefixed number of database connections and whenever you need a connection instead of creating a connection ...

53. Connection Pool    coderanch.com

54. Could not retrieve connection info from pool    coderanch.com

Hi, I am using Apache Torque for making connection with my Oracle 9i server. My Torque.properties file configuration is as follows:- torque.dsfactory.cpm.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory torque.dsfactory.cpm.pool.maxActive=10 torque.dsfactory.cpm.pool.maxWait=60 torque.dsfactory.cpm.pool.testOnBorrow=true torque.dsfactory.cpm.pool.validationQuery=SELECT 1 from dual torque.dsfactory.cpm.connection.driver = oracle.jdbc.driver.OracleDriver I am getting the following error:- Caused by: org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection info from pool at org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:169) According to me the cause of error is because of the ...

55. Connection Pooling    coderanch.com

I was wondering which connection pool to use. I'm using Tomcat, and apparantly it provides a "DBCP" connection pool. Hibernate on the other hand, which I'm also using, has built in support for the "C3PO" connection pool. Then there is the "org.apache.commons.dbcp.BasicDataSource" which I could also use. - What's the pros- and cons of the different pools, or is there an ...

56. What is connection pooling?and why would one go for it    coderanch.com

Thank you Mr KJ Reddy that was quite helpful. Now one more query... If i'm concurrently accessing two or more databases there is no doubt that i will require more than one connection. But suppose I'm going to access the databases one after another is there any way in which I can just make the existing connection refrence point to the ...

57. Connection Pooling - exhausted pool problem    coderanch.com

Hello everyone, I am having a continuous problem with a connection pool namely at one point or another it runs out of connections. Initially I had the pool initiated from within my own code but after reading one of the articles in java ranch journal I set it up at the container and also changed my code to close the connections ...

59. Pooled Connections    coderanch.com

60. how we should return a connection to connectio pool    coderanch.com

Hi How i should return a connection to connection pool ? I get connections from a data source and then when i finish my work with them i close them using con.close() , will this method return the connection to the pool or i should do something else to return in to the pool. thanks

61. connection pooling using directcoonection problem    coderanch.com

hi i am working on code which makes direct connection with database using driver manager class and stores this connections in arraylist as connection object and thus make a pool of connection which is used in program now ,once the connection is used ,it should be realsed and make available for further release. so what check needs to be done to ...

62. connection pool    coderanch.com

63. connection pooling code    coderanch.com

You require lot of coding for this. 1. Define property which holds the min and max number of objets (Threads) e.g. min_thread=5 max_thread=10 min_wait_time=1000 (10 secs) 2. Write one custom code and this code would 2.1 On startup create the min # of objects and store in some collection. 2.2 Everytime this object gets used - set one counter 2.3 When ...

64. Re Connection pooling    coderanch.com

65. Connection pool    coderanch.com

66. connection pooling    coderanch.com

hi connection pool is nothing but a set of precreated connections. for creating connection on each object it will take some amount of time to avoid that we will use connection polling. we will create this pooling by datasource in weblogic server. in weblogic server there is option is there in that we will give the drivername and username and password ...

67. Connection pools    coderanch.com

to have a connection pool you have at least two options: -use a library that create the pool (you create it in your application and your application manage the pool) and use this pool to retrieve the connections. -use applications server to create and manage the pool. in first solution you download the library and use it to create a pool ...

68. Connection pooling for different accounts    coderanch.com

Hello! I was walking thru the net to get to know how to use connectiong pooling and I found some articles describing that process. All of them were basically done with servlets! All articles recommend to create a ConnectionPool object at the servlet initialization and it's good! But the constructor of the ConnectionPool object takes the url, username, password etc... As ...

69. Connection pooling clarification    coderanch.com

70. connection pool stalling...    coderanch.com

I've used this connection pool for a few years now, but only recently has it been put to the test. Recently, a few bad queries were written to fuel some reports causing the system to come to a hault if run during a busy time. We found that once the queries were done running, the database became healthy again, but the ...

71. connection pooling    coderanch.com

Do you want a example of how to use a connection pool? Or how to implement a connection pool? Or do you want a explaination of why a connection pool is beneficial? Is this an academic exercise? Typically you would not write your own connection pool. There are several packages that can provide this functionality. If you are using a app ...

72. Which connection pool is recommended ?    coderanch.com

73. Connection pooling package    coderanch.com

Thanks Jeanne for your response. I do not plan to write my own connection pooling package. Currently I am working with WSAD that comes with WS 5.1 Test environment. If I use connection pooling provided by WS and down the road decided to move to another App Server say Apache, do I need to write the code again to use Apache ...

75. Connection Pool question    coderanch.com

76. access connection pool in data layer    coderanch.com

Scott, I looked into the service locator in the link. Kind of confused. If the web tier service locator(is a singleton) is not registered in any long-lived object, say, like servlet context(web application/web container), would it be garbage collected somtime later? My understanding is for singleton, it has to be referred so kept alive, preventing from GC. Any input? Thanks. Ningfeng ...

77. how to use JDBC Connection Pools in a standalone application?    coderanch.com

Hi, there, I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection. for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there ...

78. Design connection pooling    coderanch.com

79. min value for connection pools    coderanch.com

80. Form-Based Authentication and JDBC Connection Pool    coderanch.com

Im trying to figure out how to pass the users ID and password, using form-based authentication and file realm, to our JDBC connection. I realize the users will have to keep their file realm ID and password synchronized with their database ID and password, but we have no choice because the database is RACF protected making JDBC realm out of the ...

81. Connection Pooling    coderanch.com

82. Connection Pooling    coderanch.com

83. JDBC connection pooling    coderanch.com

I have the data source defined and am able to make connections. I guess what I am asking moreso is what is the best manner to cget the connection as well as relinquish them. The thought right now is to pass a connection as a parameter and close it using connection.close. Would that be sufficient ? thanks again in advance.

84. connection pooling    coderanch.com

I have a jsp file that uses connection pooling via - it does work, and I also have a .java file that provides access to my database. This .java file works fine when I use Class.forName(...) and DriverManager.getConnection(....), but as I understand this approach doesn't implement connection pooling - I'd like to use connection pooling. When I use ...

85. Connection Pooling    coderanch.com

86. connection pooling    coderanch.com

87. doubt in connection pooling    coderanch.com

88. Connection Pooling    coderanch.com

89. Best Database Connection Pools ?    coderanch.com

90. Connection Pooling in Non-Web App    coderanch.com

91. temporary Connection or connection pool?    coderanch.com

most servers will actually support connection pooling themselves. You should look into your particular servers details to find out how it is set up. Your web app would then access a connection via a JNDI lookup. Certainly you can do this in the Sun One webserver. I'm 99.9% certain that you can do it in tomcat by fiddling with the xml ...

92. Connection pooling    coderanch.com

94. Connection Pooling    coderanch.com

95. Connection pooling books    coderanch.com

96. connection pooling with firewall    coderanch.com

Hi all, I have a firewall which closes all the connections which are idle for 30 mins.So i have included the following connection pooling parameters inside my context file. timeBetweenEvictionRunsMillis=300000 numTestsPerEvictionRun=20 minEvictableIdleTimeMillis= 180000 I also have maxActive=50 maxIdle=100 maxWait=-1 But still its not working.Can anybody have any suggestion in this regard. regards, Ajse

97. Connection Pooling Problem?    coderanch.com

Hello, I've written a standalone Java application (first) to make sure I could insert a new blob into an Oracle Database via JDBC. That works fine. There are several steps to doing this including: 1. Doing an insert for the EMPTY_BLOB() (locator) 2. Then doing other stuff in that session, like getting the primary key just entered via the sequence. The ...

98. Connection pooling    coderanch.com

You have 2 options for Connection pooling a) make use of connection pooling created & maintained by application server & access it using JNDI.... b) If datasource is not created in application server make use of connection pooling by DBCP or C3PO Among a & b which is the recommended approach?? And in b) which is the better option in production?? ...

99. approach other than connection pooling    coderanch.com

The is not likely to be any difference in the code, but your code is probably going to use up more database resources, since a Connection will actually equal a connection to the database, rather than sharing connections in the way connection pooling does it. I suppose if you didn't want to use connection pooling you could try to write your ...

100. congested webapp connection pools    coderanch.com

A private messager has pointed out that eliminating shared instance variables eliminates the need for synchronization in order to achieve thread-safety. I had started down this multi-threaded JDBC performance-enhancement path of inquiry with the assumption that a singleton DAO is best, in order to eliminate time wasted in per-request DAO object creation. Such an approach requires a shared instance variable for ...