- 浏览: 100002 次
文章分类
最新评论
-
jXee:
lgs0626 写道求源码,兄弟给共享下吧 "jee ...
jee6 学习笔记 4 - CRUD 2: View Details, Primefaces row selection -
lgs0626:
求源码,兄弟给共享下吧
jee6 学习笔记 4 - CRUD 2: View Details, Primefaces row selection
If you ever came across this warning message from JBoss, you might wonder what's wrong:
WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
It's relevant to JBoss Transaction Management Service for multiple datasources. That is, you have multiple datasources configured and your transactions span multiple data sources. In this case, you need to configure them as XA datasources so that JBoss would not complain.
This is often the case when using Oracle, as you can have multiple users/schema in one database. My test showed this is when XA datasources should be configured.
For instance, we can have two users "BILLING" and "LOG" in one Oracle database. We need to configure two datasources for each of them. If transactions span across these two users, we need to configure xa-datasources:
Another point is that javax.transaction.UserTransactiion is the JTA api for explicit management of transaction boundaries. This api cannot work properly without JBoss transaction management service turned on. That is, it only works with local-tx-datasource and xa-datasource configurations, not no-tx-datasource. Since it's part of the container's (JBoss for example) Transaction Management Service.
WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
It's relevant to JBoss Transaction Management Service for multiple datasources. That is, you have multiple datasources configured and your transactions span multiple data sources. In this case, you need to configure them as XA datasources so that JBoss would not complain.
This is often the case when using Oracle, as you can have multiple users/schema in one database. My test showed this is when XA datasources should be configured.
For instance, we can have two users "BILLING" and "LOG" in one Oracle database. We need to configure two datasources for each of them. If transactions span across these two users, we need to configure xa-datasources:
<xa-datasource> <jndi-name>BILLINGDS_XA</jndi-name> <track-connection-by-tx>true</track-connection-by-tx> <isSameRM-override-value>false</isSameRM-override-value> <managedconnectionfactory-class>org.jboss.resource.adapter.jdbc.xa.oracle.XAOracle ManagedConnectionFactory</managedconnectionfactory-class> <transaction-isolation></transaction-isolation> <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class> <xa-datasource-property name="URL">jdbc:oracle:thin:@dbserverIP:1521:SID</xa-datasource-property> <xa-datasource-property name="User">BILLING</xa-datasource-property> <xa-datasource-property name="Password">passwordOfBILLING</xa-datasource-property> <min-pool-size>5</min-pool-size> <max-pool-size>10</max-pool-size> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.Oracle ExceptionSorter</exception-sorter-class-name> <mbean code="org.jboss.resource.adapter.jdbc.xa.oracle.Or acleXAExceptionFormatter" name="jboss.jca:service=OracleXAExceptionFormatter"> <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends> </mbean> </xa-datasource> <xa-datasource> <jndi-name>LOGDS_XA</jndi-name> <track-connection-by-tx>true</track-connection-by-tx> <isSameRM-override-value>false</isSameRM-override-value> <managedconnectionfactory-class>org.jboss.resource.adapter.jdbc.xa.oracle.XAOracle ManagedConnectionFactory</managedconnectionfactory-class> <transaction-isolation></transaction-isolation> <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class> <xa-datasource-property name="URL">jdbc:oracle:thin:@dbserverIP:1521:SID</xa-datasource-property> <xa-datasource-property name="User">LOG</xa-datasource-property> <xa-datasource-property name="Password">passwdOfLOG</xa-datasource-property> <min-pool-size>5</min-pool-size> <max-pool-size>10</max-pool-size> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.Oracle ExceptionSorter</exception-sorter-class-name> <mbean code="org.jboss.resource.adapter.jdbc.xa.oracle.Or acleXAExceptionFormatter" name="jboss.jca:service=OracleXAExceptionFormatter"> <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends> </mbean> </xa-datasource>
Another point is that javax.transaction.UserTransactiion is the JTA api for explicit management of transaction boundaries. This api cannot work properly without JBoss transaction management service turned on. That is, it only works with local-tx-datasource and xa-datasource configurations, not no-tx-datasource. Since it's part of the container's (JBoss for example) Transaction Management Service.
发表评论
-
ActiveMQ and Spring JMS Framework Message Loss
2019-06-28 07:15 29Java Message Service (JMS) prov ... -
how to proxy to k8s web console
2018-06-28 07:16 567### how to access k8s web conso ... -
Call Stored Procedure with JPA 2.1
2018-06-27 10:57 669JPA 2.1 introduces APIs to call ... -
Send response and then process - async processing
2017-10-12 09:35 558If your request processing take ... -
java 8 time api test
2017-08-29 05:40 480public class ParseUtcDateTime ... -
Setup ApiKey in header with Swagger generated client code
2017-08-23 06:41 479@Value("${api.base.path} ... -
Simple tool to monitor jvm memory usage and garbage collection
2016-10-13 06:06 363JDK has built-in tool to moni ... -
Externalize Application Config properties with JBoss 7.1
2017-06-02 12:09 338If you have configuration pro ... -
JPA native query does not support setting list parameters
2014-03-27 06:45 1013you might want to do the ... -
Owning Side and Inverse Side of JPA entity relationships
2013-09-10 07:08 811Entity relationships may be b ... -
avoid setParameter for "order by" in JPQL
2013-03-07 05:55 780you might want to create a JP ... -
JPA Path Expression, operator IN and Collection properties
2013-01-23 16:25 1399If we want to select the Orde ... -
与JEE6/EJB3.1相比, Spring framework 丧失了几乎所有的优势
2013-01-19 13:13 1038The Spring framework was a ma ... -
Simple EasyMock tutorial
2012-12-20 11:57 675http://veerasundar.com/blog/20 ... -
Servlet 3.0 @WebFilter and @WebServlet
2012-12-04 07:09 2697Servlet 3.0 provides new annota ... -
Why JSF2 @ViewScoped not working?
2012-12-03 06:55 1371javax.faces.bean.ViewScoped sai ... -
java ee transaction and datasource concepts
2012-11-10 13:48 10481. What is a transaction? A tra ... -
Use Oracle DBCA silent mode to create new database from template
2012-10-12 12:23 2946### command line to use Orac ... -
manually drop and delete an Oracle database
2012-10-06 19:43 766Using DBCA command line to dele ... -
cold back up an oracle database
2012-10-06 19:23 802Refrence: search "Oracle ...
相关推荐
this is a powerful tool to configure network, please download both clientside and serverside.
标题 "Tomcat6.x Configure DataSource" 指的是在Tomcat 6.x版本中配置数据源(DataSource)的过程。在Java应用服务器中,数据源是一个关键组件,它负责管理数据库连接,提供给应用程序使用。配置数据源能提高性能,...
Thread Configuration provides several parameters to configure the Thread Management functions. Timer Configuration provides several parameters to configure the Timer Management functions. Event ...
This article introduces how to configure ODBC DSN in Client to access remote DB2 for windows in detail. Then I give a sample how to access remote DB2 database with ODBC by DB Query Analyzer ...
This article introduces how to configure ODBC DSN in Server to access local DB2 for windows in detail. Then I give a sample how to access local DB2 database with ODBC by DB Query Analyzer expediently.
在描述中提到的“Failed to configure driver: unknown error. Failed to open driver”是一个常见的错误提示,意味着在安装或配置HAXM时遇到了问题。 Intel HAXM依赖于计算机的硬件虚拟化功能,尤其是CPU的虚拟化...
How to configure DCM UDS with the DEXT Editor.pdf
How to Configure Odoo 13 on Pycharm Ubuntu 18 ubuntu18下安装ODOO13 pycharm配置ODOO13开发环境
Networkers2009:BRKNMS-2004 - 13 Smart Ways To Configure your Cisco IOS Network Elements
"vim-configure.tar.gz_vim_vim_configure" 是一个包含了 Vim 配置文件的压缩包,旨在帮助用户优化 Vim 的使用体验,提供自动提示、补全功能以及代码高亮等特性。 在 Vim 中配置这些功能,可以使编辑效率大幅提升。...
- 示例:`./configure --srcdir=/path/to/src` 16. **`--cache-file=FILE`** - 用途:指定缓存文件名,用于存储`configure`脚本的测试结果,以便加快后续的配置过程。 - 示例:`./configure --cache-file=my_...
2. **设置Block**:在初始化DataSource时,传入Block,例如`self.configureCellBlock = configureBlock;`。 3. **实现DataSource协议**:在DataSource类中实现UITableViewDataSource或UICollectionViewDataSource等...
Getting Started with Grunt: The JavaScript Task Runner provides you with all the information you need to become an effective Grunt power-user. You will quickly learn how to install, configure, and run...
《Oracle Configure To Order Implementation Manual, Release 11i》是一份详尽的指南,由Oracle Corporation出版,旨在为用户和实施团队提供关于如何在企业环境中配置、部署和管理Oracle Configure To Order (CTO)...
标题“Using autoreconf to Update configure Scripts”涉及的是在开源软件开发中,如何利用`autoreconf`工具来更新配置脚本的过程。`autoreconf`是GNU构建系统的一部分,主要用于自动化配置步骤,确保源代码包能够...
标题"Qt5 configure参数说明文档"指的是此文档旨在解释和说明如何使用Qt5软件框架中的configure工具的参数。configure是一个用于为特定系统配置源代码树的脚本,以便于编译并安装Qt5及其相关组件。文档中可能会详细...
而`configure`脚本作为源码安装的重要步骤,是理解和掌握Linux软件安装基础的关键。`configure`脚本通常由`autoconf`工具生成,用于检测系统的特性和配置,以便自动生成适合当前系统的`Makefile`。 `configure`脚本...
《libmodbus 3.14:解决configure.js错误详解》 libmodbus是一个流行的开源库,用于实现Modbus通信协议。它支持多种操作系统,包括Linux、Windows和FreeRTOS等,广泛应用于工业自动化、物联网设备以及其他需要进行...
- **示例**:如果源代码位于`/path/to/source`,可以使用命令`./configure --srcdir=/path/to/source`。 #### 总结 通过上述介绍,我们可以看到`configure`脚本提供了丰富的选项来满足不同场景下的需求。合理利用...