简体   繁体   中英

Configure a MongoDB datasource for connection pooling in JBoss

Would anyone be able to help me achieve connection pooling in Jboss by configuring a MongoDB datasource? I've already followed the steps in one of the threads here Configuring MongoDB datasource in JBoss 7 but that doesn't explain precisely how I could achieve connection pooling.I'm using Jboss EAP 6.4.0.

First, you have to define your datasource in the jboss server. In this case, you have to setup the driver for MongoDB. See the documentation .

Then you just need to add the element <pool> inside your <datasource> definition:

<pool>
   <min-pool-size>1</min-pool-size>
   <max-pool-size>2</max-pool-size>
</pool>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM