简体   繁体   English

使用 dblookup mediator 在 wso2 中关闭 session

[英]To close session in wso2 using dblookup mediator

I have one question: how can I close the database connection in wso2 manually when using dblookup mediator?我有一个问题:如何在使用dblookup mediator时手动关闭wso2中的数据库连接? I saw the dblookup mediator code on github [here] ( https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java ).我在 github [此处] ( https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/mediators/db/ DBLookupMediator.java )。 I saw that the dblookup mediator code uses the "finally" part of the code where all connections are closed, BUT when I check all active sessions to the database, I see that the connections are still open.我看到 dblookup 中介程序代码使用代码的“最后”部分,其中所有连接都关闭,但是当我检查数据库的所有活动会话时,我看到连接仍然打开。

It seems the DblookUp Mediator maintains a connection pool. DblookUp Mediator似乎维护着一个连接池。 Hence closing the connection may return it back to the pool.因此关闭连接可能会将其返回到池中。 If you want to reduce the size of the pool probably you can try tuning the connection pool settings.如果您想减小池的大小,您可以尝试调整连接池设置。 For example this property maxactive will set max active connections.例如,此属性maxactive将设置最大活动连接数。 Take a look at this document.看看这份文件。

Also, AFAIK there is no way to manually flush the connections.此外,AFAIK 无法手动刷新连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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