Connection Shareable测试
来源:互联网 发布:js 代码整理 编辑:程序博客网 时间:2024/06/05 07:05
Connection Shareable是对XA资源的一个优化。
原因: XA资源的提交代价比较大,如果同一个应用(要求在同一个线程中)连续得到的两个XA链接都是同一个EIS时,那么就可以优化成一个连接,变为了LocalTransaction,提高了性能。
========
测试代码
========
com.sun.appserv.jdbc.DataSource res_unshare = (com.sun.appserv.jdbc.DataSource)ctx.lookup("java:comp/env/DataSourceNoShare");com.sun.appserv.jdbc.DataSource res_share = (com.sun.appserv.jdbc.DataSource)ctx.lookup("java:comp/env/DataSourceShare");for(int i=0; i<num; i++) { conns[i] = shareable ? res_share.getConnection(res_share.getConnection()) : res_unshare.getConnection(res_unshare.getConnection()); rt[i] = conns[i].toString();}
========
ejb-jar.xml
========
<?xml version="1.0" encoding="UTF-8"?><ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0"> <enterprise-beans> <session> <ejb-name>jcatest</ejb-name> <local>com.jca.test.JCAPool_InitialLocal</local> <resource-ref> <res-ref-name>DataSourceNoShare</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Unshareable</res-sharing-scope> <mapped-name>jdbc/__default</mapped-name> </resource-ref> <resource-ref> <res-ref-name>DataSourceShare</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> <mapped-name>jdbc/__default</mapped-name> </resource-ref> </session> </enterprise-beans></ejb-jar>
- Connection Shareable测试
- 关于Connection的一个测试
- APPIUM测试Inspecter connection error问题
- connection
- Connection
- Connection
- Connection
- Connection
- Connection
- Connection
- warning: shared library text segment is not shareable
- 解决隐私问题的一个绝妙方案:Big Shareable Browser
- Make your ggplots shareable, collaborative, and with D3
- CMake Error: shared library text segment is not shareable
- cactus+jetty+eclipse测试时的Connection refused问题
- ab压力测试: apr_socket_recv: Connection timed out (110)
- soapui测试https报connection reset的解决方案
- Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=
- 关于DEV皮肤的换肤 也是系统风格的代码 C#
- Android low memory killer 详解
- 发送消息,避免数据损失 --数据库维护经验一则
- AT&T汇编与gcc内联汇编
- 提高javascript性能之 条件语句
- Connection Shareable测试
- 在oracle中,用union合并blob类型
- Linux内核实践 - 如何添加网络协议[三]:实现
- Android的对话框----(Dialog)
- 如何保留低端内存
- 扩展OutputDebugString,自定义Trace
- 转折-JQ
- Select For update语句浅析
- jquery创建表格