pax-transx 프로젝트는 OSGi의 JTA/JTS 트랜잭션 관리와 JDBC 및 JMS에 대한 리소스 풀링을 지원합니다. pax-jdbc 와 pax-jms 간의 격차를 닫습니다.
pax-jdbc 는 구성 옵션 및 javax.sql.(XA)ConnectionFactory 서비스에 대한 검색 기능을 추가하고 일부 JDBC 풀링 구현을 제공합니다.
pax-jms 는 javax.jms.(XA)ConnectionFactory 서비스에 대해 동일한 작업을 수행하고 일부 JMS 풀링 구현을 제공합니다.
pax-transx 는 javax. Cryostat.TransactionManager 구현에 대한 구성 옵션 및 검색을 추가하며 (finally) 풀링 및 tranasction 지원을 통해 JCA 기반 JDBC/JMS 연결 관리를 제공합니다.
JDBC 연결 풀 및 JMS 연결 풀에 대한 섹션은 여전히 유효합니다. JCA 기반 풀을 사용하는 데 필요한 유일한 변경 사항은 JDBC 데이터 소스 및 JMS 연결 팩토리를 등록할 때 pool=transx 속성을 사용하는 것입니다.
pax-jdbc-pool-transx 는 org.ops4j.pax.transx.jdbc.ManagedDataSourceBuilder 에서 pax-transx-jdbc를 사용합니다.
pax-jms-pool-transx 는 org.ops4j.pax.transx.jms.ManagedConnectionFactoryBuilder 에서 pax-transx-jms를 사용합니다.
풀링된 데이터 소스/연결 팩토리는 빌더 스타일 (Java™ans 속성 없음)에서 생성되는 반면, 이러한 속성은 JDBC에서 지원됩니다.
name
userName
암호
commitBeforeAutocommit
preparedStatementCacheSize
transactionIsolationLevel
minIdle
maxPoolSize
aliveBypassWindow
houseKeepingPeriod
connectionTimeout
idleTimeout
maxLifetime
이러한 속성은 JMS에서 지원됩니다.
name
userName
암호
clientID
minIdle
maxPoolSize
aliveBypassWindow
houseKeepingPeriod
connectionTimeout
idleTimeout
maxLifetime
XA 복구를 위해서는 사용자 이름과암호 속성이 필요합니다( Fuse 6.x의 aries.xa.username 및 aries.xa.password 속성과 마찬가지로).
블루프린트에서 이 JDBC 구성을 사용하여 (mind pool=transx)
<!--
Database-specific, non-pooling, non-enlisting javax.sql.XADataSource
-->
<bean id="postgresql" class="org.postgresql.xa.PGXADataSource">
<property name="url" value="jdbc:postgresql://localhost:5432/reportdb" />
<property name="user" value="fuse" />
<property name="password" value="fuse" />
<property name="currentSchema" value="report" />
<property name="connectTimeout" value="5" />
</bean>
<!--
Expose database-specific data source with service properties
No need to expose pooling, enlisting, non database-specific javax.sql.DataSource - it'll be registered
automatically by pax-jdbc-config with the same properties as this <service>, but with higher service.ranking
-->
<service id="pool" ref="postgresql" interface="javax.sql.XADataSource">
<service-properties>
<!-- "pool" key is needed for pax-jdbc-config to wrap database-specific data source inside connection pool -->
<entry key="pool" value="transx" />
<!-- <service>/@id attribute doesn't propagate, but name of the datasource is required using one of: -->
<entry key="osgi.jndi.service.name" value="jdbc/postgresql" />
<!-- or: -->
<!--<entry key="dataSourceName" value="jdbc/postgresql" />-->
<!-- Other properties, that normally are needed by e.g., pax-jdbc-pool-transx -->
<entry key="pool.maxPoolSize" value="13" />
<entry key="pool.userName" value="fuse" />
<entry key="pool.password" value="fuse" />
</service-properties>
</service>
<!--
Database-specific, non-pooling, non-enlisting javax.sql.XADataSource
-->
<bean id="postgresql" class="org.postgresql.xa.PGXADataSource">
<property name="url" value="jdbc:postgresql://localhost:5432/reportdb" />
<property name="user" value="fuse" />
<property name="password" value="fuse" />
<property name="currentSchema" value="report" />
<property name="connectTimeout" value="5" />
</bean>
<!--
Expose database-specific data source with service properties
No need to expose pooling, enlisting, non database-specific javax.sql.DataSource - it'll be registered
automatically by pax-jdbc-config with the same properties as this <service>, but with higher service.ranking
-->
<service id="pool" ref="postgresql" interface="javax.sql.XADataSource">
<service-properties>
<!-- "pool" key is needed for pax-jdbc-config to wrap database-specific data source inside connection pool -->
<entry key="pool" value="transx" />
<!-- <service>/@id attribute doesn't propagate, but name of the datasource is required using one of: -->
<entry key="osgi.jndi.service.name" value="jdbc/postgresql" />
<!-- or: -->
<!--<entry key="dataSourceName" value="jdbc/postgresql" />-->
<!-- Other properties, that normally are needed by e.g., pax-jdbc-pool-transx -->
<entry key="pool.maxPoolSize" value="13" />
<entry key="pool.userName" value="fuse" />
<entry key="pool.password" value="fuse" />
</service-properties>
</service>
Copy to ClipboardCopied!Toggle word wrapToggle overflow
블루프린트의 이 JMS 구성으로 (mind pool=transx)
<!--
Broker-specific, non-pooling, non-enlisting javax.jms.XAConnectionFactory
-->
<bean id="artemis" class="org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory">
<argument index="0" value="tcp://localhost:61616" />
<!-- credentials needed for JCA-based XA-recovery -->
<argument index="1" value="admin" />
<argument index="2" value="admin" />
<property name="callTimeout" value="2000" />
<property name="initialConnectAttempts" value="3" />
</bean>
<!--
Expose broker-specific connection factory with service properties
No need to expose pooling, enlisting, non broker-specific javax.jms.XAConnectionFactory - it'll be registered
automatically by pax-jms-config with the same properties as this <service>, but with higher service.ranking
-->
<service id="pool" ref="artemis" interface="javax.jms.XAConnectionFactory">
<service-properties>
<!-- "pool" key is needed for pax-jms-config to wrap broker-specific connection factory inside connection pool -->
<entry key="pool" value="transx" />
<!-- <service>/@id attribute doesn't propagate, but name of the connection factory is required using one of: -->
<entry key="osgi.jndi.service.name" value="jms/artemis" />
<!-- or: -->
<!--<entry key="name" value="jms/artemis" />-->
<!-- Other properties, that normally are needed e.g., pax-jms-pool-transx -->
<entry key="pool.maxPoolSize" value="13" />
<entry key="pool.userName" value="admin" />
<entry key="pool.password" value="admin" />
</service-properties>
</service>
<!--
Broker-specific, non-pooling, non-enlisting javax.jms.XAConnectionFactory
-->
<bean id="artemis" class="org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory">
<argument index="0" value="tcp://localhost:61616" />
<!-- credentials needed for JCA-based XA-recovery -->
<argument index="1" value="admin" />
<argument index="2" value="admin" />
<property name="callTimeout" value="2000" />
<property name="initialConnectAttempts" value="3" />
</bean>
<!--
Expose broker-specific connection factory with service properties
No need to expose pooling, enlisting, non broker-specific javax.jms.XAConnectionFactory - it'll be registered
automatically by pax-jms-config with the same properties as this <service>, but with higher service.ranking
-->
<service id="pool" ref="artemis" interface="javax.jms.XAConnectionFactory">
<service-properties>
<!-- "pool" key is needed for pax-jms-config to wrap broker-specific connection factory inside connection pool -->
<entry key="pool" value="transx" />
<!-- <service>/@id attribute doesn't propagate, but name of the connection factory is required using one of: -->
<entry key="osgi.jndi.service.name" value="jms/artemis" />
<!-- or: -->
<!--<entry key="name" value="jms/artemis" />-->
<!-- Other properties, that normally are needed e.g., pax-jms-pool-transx -->
<entry key="pool.maxPoolSize" value="13" />
<entry key="pool.userName" value="admin" />
<entry key="pool.password" value="admin" />
</service-properties>
</service>
Copy to ClipboardCopied!Toggle word wrapToggle overflow
JCA 기반 리소스 관리를 활용하는 JDBC 데이터 소스 및 JMS 연결 팩토리가 있습니다. Transx 기반 풀은 XA 복구와 관련하여 pax-transx-tm-narayana 와 적절하게 통합됩니다.