天道酬勤,学无止境

pooling

org.apache.tomcat.jdbc.pool.DataSource is no longer in the tomcat 7 dbcp jar?

I am trying to create a spring-managed standalone pool for tomcat-dbcp using the version 7.0.30 of tomcat-dbcp.jar However it seems the org.apache.tomcat.jdbc.DataSource class that is referred to in the Tomcat's documentation (http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Standalone) <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close"> <property name="factory" value="org.apache.tomcat.jdbc.pool.DataSourceFactory" /> <property name="type" value="javax.sql.DataSource" /> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property

2021-06-15 05:48:21    分类:问答    spring   tomcat   pooling

Database Connections Timing Out (Connection Pooling On Tomcat)

My dB connections are constantly timing out. I looked through some of the solutions people have offered to this, and have implemented them, but nothing has worked out till now. Any new thoughts, will be very helpful. Problem For some requests to the webapp, this is the error I am getting : com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was 11,198,881 milliseconds ago. The last packet sent successfully to the server was 11,198,881 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and

2021-06-11 20:52:36    分类:问答    tomcat   connection   pooling

Connection pooling with Java and MySQL in Tomcat web application

I recently wrote and deployed a Java web application to a server and I'm finding an unusual problem which didn't appear during development or testing. When a user logs in after so long and goes to display data from the database, the page indicates that there are no records to see. But upon page refresh, the first x records are shown according to the pagination rules. Checking the logs, I find: ERROR|19 09 2009|09 28 54|http-8080-4|myDataSharer.database_access.Database_Metadata_DBA| - Error getting types of columns of tabular Dataset 12 com.mysql.jdbc.CommunicationsException: Communications

2021-06-11 10:54:21    分类:问答    java   mysql   tomcat   connection   pooling

Is there a standard way of implementing a proprietary connection pool in .net?

Is there a standard connection pooling model (or API) similar to that used by the data providers in .net that I could use to implement my own connection pool? I ask because I have a requirement to implement my own connection pool to a proprietary TCP/IP device that we use in a web service. The current problem is that there are lot of connections (read too many) to the device due to the threaded nature of web services running under IIS. I want to limit the number of these connections using my own connection pool and it seems stupid to reinvent the wheel if there is a standard model I could use

2021-06-10 04:50:34    分类:问答    c#   .net   api   pooling

How to pool objects in Spring?

I'm following this tutorial regarding how to pool objects in Spring. I've followed the instruction written on the tutorial but when I run my application, it always generates a new instance of the object. I'm expecting that since I'm pooling the objects, existing objects will be reuse. As such, no new instances should be created. Also, when I access of the getter method of the bean, a new instance of the bean is created again. What could have I done wrong? Did I misunderstood the concept of pooling in Spring? Below is my code: Application Context: (This is just the body of my application

2021-06-09 14:54:27    分类:问答    java   spring   spring-3   spring-aop   pooling

Thread Pool vs Many Individual Threads

I'm in the middle of a problem where I am unable decide which solution to take. The problem is a bit unique. Lets put it this way, i am receiving data from the network continuously (2 to 4 times per second). Now each data belongs to a different, lets say, group. Now, lets call these groups, group1, group2 and so on. Each group has a dedicated job queue where data from the network is filtered and added to its corresponding group for processing. At first I created a dedicated thread per group which would take data from the job queue, process it and then goes to blocking state (using Linked

2021-06-05 12:21:18    分类:问答    java   multithreading   pool   pooling   spawning

Is there a way to reuse a NHibernate SessionFactory for multiple databases?

Like the title says, is there a way to "reuse" a SessionFactory for multiple databases? Since instantiating the SessionFactory takes time, I wonder if it would be possible to pool these instances and reuse them, changing only the connection/database name. Obviously, first level cache would be cleared, but I am trying to avoid the penalty involved in instantiating the factory itself. The background is that I can have several small "pluggable" databases with exactly the same schema, so there is no need for NHibernate to rebuild all mappings every time.

2021-06-03 18:51:47    分类:问答    .net   nhibernate   sessionfactory   pooling

Best Method of Channel Pooling in Google App Engine

It seems the only way to make the GAE Channel API financially viable is to implement some kind of pooling mechanism (one of the senior app engine product managers even told me this when I emailed them about the exorbitant price) to reuse channels that have not yet expired. I've been brainstorming ways (places) to implement a channel pool, but each method I think of has some pretty serious drawbacks. Static memory of a Servlet -- Good, but will drop quite a bit of open channels when a new VM instance opens and/or a client gets passed from one VM to another. Memcache -- At least the memory is

2021-05-15 17:55:08    分类:问答    google-app-engine   channel   pooling   channel-api

tomcat 7.0.42池化,hibernate 4.2,mysql坚如磐石的自动重新连接解决方​​案(tomcat 7.0.42 pooling, hibernate 4.2, mysql rock solid autoreconnect solution)

问题 我已经阅读了很多有关从休眠会话自动重新连接到mysql的问题的帖子。 其他人提到增加了mysql wait_timeout(不是我的最爱),使用autoReconnect = true(不推荐),测试连接等,我目前正在尝试一些选项,但是我想问问是否有人使用tomcat的连接池有坚如磐石的解决方案(不是休眠的c3po)。 我正在查看最防弹的jndi设置,即使它们并不是调整的最佳性能也是如此。 非常感谢你, 问候 回答1 很好的问题。 我曾经为这个问题而苦恼。 对于stackoverflow而言,最常见的答案是“几乎所有问题都取决于……”。 我讨厌这么说,但是没有什么比调整您的连接池更重要的了。 这确实是一个供需游戏,其中连接请求是需求,供应是MySQL可用的连接数。 这实际上取决于您的主要关注点是防止从池中返回陈旧的连接,还是您的关注点在于确保MySQL不会因空闲连接而过载,因为您没有足够快地杀死它们。 大多数人躺在中间的某个地方。 如果您真的了解为什么有人会选择任何一种连接池配置,那么请相信我,您将停止搜索“ Rocket Solid”设置,因为您会知道这就像在商店搜索业务计划一样; 它完全取决于您获得了多少个连接请求以及您愿意提供多少个持久性连接。 下面我举例说明为什么要使用某些设置。 我引用了在Context.xml文件的“上下文”标记的“资源”标记中必须更改的变量。

2021-04-27 22:15:00    分类:技术分享    mysql   hibernate   tomcat   pooling

Mean or max pooling with masking support in Keras

... print('Build model...') model = Sequential() model.add(Embedding(max_features, 128)) model.add(LSTM(size, return_sequences=True, dropout_W=0.2 dropout_U=0.2)) model.add(GlobalAveragePooling1D()) model.add(Dense(1)) model.add(Activation('sigmoid')) .... I need to be able to take the mean or max of the vectors for all time steps in a sample after LSTM layer before giving this mean or max vector to the dense layer in Keras. I think timedistributedmerge was able to do this but it was deprecated. Using return_sequences=True I can obtain the vectors for all time steps in a sample after the LSTM

2021-04-24 09:48:10    分类:问答    python   masking   keras   lstm   pooling