Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Per-user data-source connection pools (via security-domain) in jboss-6.0.0.Final vs wildfly-10.1.0.F

Ranch Hand
Posts: 125
Postgres Database BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello dear forum!

Back with Jboss-6.0.0.Final we had the following data-source/pool definition :

The definition for security-domain postgresqluser was:

So this gave us one pool per user with max size 5 (5 is the most that app requires + 1). If one user abused the system, and try to get more than 5 connections (e.g by pressing F5 quickly) the rest of users were unaffected since all he/she could do was to block waiting for more connections.

Now we migrated the above configuration to wildfly-10.1.0.Final as follows :

The behavior we have witnessed is different, it seems that wildfly gives the first user his 5 connections, who is able to work as long as no other user logs into the system. When the second users logs in, it seems to give to him his 5 connections (by looking into postgresql activity and logs) but it doesn't seem to be able to do any work with all 10 connections at the same time, then the second user gets blocked or some connection attempts of the first user get blocked as well. By specifying max-pool-size=10 in wildfly seems to be able to handle the first two users successfully. I know (by looking at the logs) the default pool in wildfly uses strategy : org.jboss.jca.core.connectionmanager.pool.strategy.PoolBySubjectAndCri . So I guess now in wildfly subpools' semantics have been changed to meaning partitioning of the same single pool, instead of multiple pool instances as used to be the case in jboss-6.0.0.Final.

Is my understanding correct? And if yes, which means max-pool-size applies to the whole pool, then is there a way to limit connections per user? (I know we could limit the users at the database layer, but we would like to be able to replicate the old behavior, before we move on to new changes).
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic