connection-pooling

Hibernate 5: db connections are still not released (idle in transaction) after lazy loading

寵の児 提交于 2019-12-11 10:57:53
问题 In Hibernate 5 there are still big troubles with releasing database connections after initialization of lazy collection. Database connections after lazy initialization of collection are kept in "idle in transaction". So if many users work at the same time, count of open connections is increasing critically. We use hibernate version 5.0.12 , java version 1.8.0_151 , jsf 2.3 , don't use Spring (ORM). There is reported issue for Hibernate version 3.2.7 - HHH-4808 - still opened. The last comment

Connection pool. call a procedure each time an operation is made

梦想与她 提交于 2019-12-11 09:27:56
问题 Hei there, I'm working on a Primefaces 5/JSF 2/Mybatis webapp. My question is. To know each time who did what (on the app) we have to execute a method setUser(...). The company I'm working in right now, had a C# version of the app we are building now but there were no connection pools there so they only had to execute that procedure when the user logged in. (right now we just call that method in the getSQLFactory method, which I know is not best practice... but that looked like the only

TimeoutException for CloseableHttpAsyncClient

主宰稳场 提交于 2019-12-11 09:25:41
问题 i am trying to connect consume api using CloseableHttpAsyncClient . I making call to the api with connection pool of 45 and timeout of 5 minutes. However, i get the following error: java.util.concurrent.TimeoutException: null at org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(AbstractNIOConnPool.java:364) at org.apache.http.nio.pool.AbstractNIOConnPool.processNextPendingRequest(AbstractNIOConnPool.java:344) at org.apache.http.nio.pool.AbstractNIOConnPool.release

How to create one database connection per user on a Java Servlet application?

会有一股神秘感。 提交于 2019-12-11 08:59:19
问题 I am working on a website using Java Servlets and my research showed me that it is best to keep one database connection per user (rather than have only one connection sitting all the time on the background or connect to the database every time that a transaction needs to be made). I don't know how to accomplish this, however. What I am currently doing is in my Data Access Object class I have a private static Connection conn; and I have a HTTPSessionListener - on sessionCreated event I connect

Tomcat Connection Pool configuration: attributes settings. Examples and suggestions

半腔热情 提交于 2019-12-11 08:34:07
问题 In the context.xml file of my web application, I use: <Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource" removeAbandoned="true" removeAbandonedTimeout="60" maxActive="30" maxIdle="30" maxWait="10000" username="myuser" password="mypwd" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" closeMethod="close" validationQuery="select 1" testOnBorrow="true" /> It works, but I'm not really sure if

Hibernate connections are not released after lazy collection initialization

浪尽此生 提交于 2019-12-11 07:47:44
问题 After upgrading to hibernate 4.2.4 from 3.6 database connections are not returned to pool after initialisation of lazy collection. As a result connection pool is exhausted very quickly when number of users exceeds number of connections in the pool. Similar symptoms are described in HHH-4808 but we haven't observed these problems in Hibernate 3.1-3.6 Relevant settings: hibernate.connection.autocommit=true hibernate.connection.release_mode=after_transaction After collection is initialized there

Using Statement and Connection Pooling

北城以北 提交于 2019-12-11 07:11:55
问题 I recently came to know the concept of 'connection pooling' in .NET, and as such I have a little doubt I would like anyone to clarify it for me. If I use the following piece of code, when will the database connection be returned to the pool so that it can be used by another part of the application? using (SqlConnection NewConnection = new SqlConnection(ConnectionString)) { using (SqlCommand NewCommand = new SqlCommand("SomeCommand", NewConnection)) { try { NewConnection.Open(); // Do some

connection pool - SQLAlchemy & Flask

那年仲夏 提交于 2019-12-11 06:29:47
问题 I have a situation. I am having a code which uses SQLAlchemy for database activities. And have application made in flask, flask_restful to access the db codes. Now while testing, through unittest, i am facing some issues. And i m sure it is because Flask keeps the connection open after a request completes. So i want to implement connection pooling in my codes to check.I went through the connection pooling official docs of SQLAlchemy. And here are my questios - So in docs it is written that by

How to use connection pooling in Jboss

自古美人都是妖i 提交于 2019-12-11 06:16:17
问题 I am supposed to use JBoss connection pooling for my application.Right now I don't have any idea about that. I Googled but couldn't get any good link. Can you please share any good link which describes how to define data source, create and use connections in Java ? 回答1: Probably this is what you r looking for: http://www.coderanch.com/t/89511/JBoss/Connection-Pooling This snippet returns the database connection as declared in the xml fragment: InitialContext jndiCntx = new InitialContext();

Cloudant - Connection Pooling

和自甴很熟 提交于 2019-12-11 04:57:22
问题 I am trying connection pooling with cloudant database. From what I understand, the cloudant database inherently does connection pooling with the default parameter of max_connections = 6. max_connections code. The code snippet required is at line 130. I have a working application written in scala using akka-http with the following initialisation : val client: CloudantClient = ClientBuilder.account(<accountdetails>) .username(<my user name>) .password(<my password>).maxConnections(20) .build()