简体   繁体   English

Weblogic应用程序服务器中的主要SQLException(与XA相关)

[英]Major SQLException (XA related) in Weblogic application Server

We're developing a software with Weblogic application server (12.1.1.0); 我们正在使用Weblogic应用服务器(12.1.1.0)开发软件; We have one domain with two applications. 我们在一个域中有两个应用程序。

We just moved up from development DB to pre-production DB (similar to production), and oh boy we got a major issue going... 我们只是从开发数据库升级到了生产前数据库(类似于生产),哦,天哪,我们遇到了一个主要问题……
DBA says the DBs are running the same version - Oracle 11 (I don't recall the exact version). DBA说数据库正在运行相同的版本-Oracle 11(我不记得确切的版本)。 The only difference we can see is that the dvlp DB uses SID for connection, and the other two uses service-name. 我们可以看到的唯一区别是dvlp DB使用SID进行连接,而其他两个使用service-name。

Now, in our domain we have two data sources X and Y. Both are connected to the same DB. 现在,在我们的域中,我们有两个数据源X和Y。它们都连接到同一个DB。 We use XA driver on both. 我们都使用XA驱动程序。 Both our applications uses the same 'persistence.xml' (and entities) which has two PUs (persistence units), each using a different data source (X and Y). 我们两个应用程序都使用相同的“ persistence.xml”(和实体),该实体具有两个PU(持久性单元),每个PU使用不同的数据源(X和Y)。

The problem is this: 问题是这样的:

  1. An MDB starts handling a request. MDB开始处理请求。
  2. It uses both PUs with EntityManagers and the Y data source with DataSource interface, which is used to get a connection (we have some JDBC code). 它同时使用带有EntityManager的PU和带有DataSource接口的Y数据源,后者用于获得连接(我们有一些JDBC代码)。
  3. It calls a bean from the other application. 它从另一个应用程序调用bean。
  4. The other bean tries to use one of the PUs (the one connected to X data source). 另一个bean尝试使用其中一个PU(一个连接到X数据源)。
  5. SQLException is thrown: 抛出SQLException:

    XA error: XAResource.XAER_NOTA start() failed on resource 'x_my_domain': XAER_NOTA : The XID is not valid

We've searched the error online and we found out that we should change the data sources' configuration to 我们已经在线搜索了错误,发现应该将数据源的配置更改为
XASetTransactionTimeout=true
XATransactionTimeout=0
but that didn't worked. 但这没有用。

We've also tried (a lot) to tweak the data sources' configuration, eventually removing one of them so we only need to tweak with only one of them, but nothing has worked. 我们还尝试了(很多)调整数据源的配置,最终删除了其中之一,因此我们只需要调整其中一个,但没有任何效果。

In addition, while repeatedly tweaking the configuration, a different SQLException has slipped under our radar and started popping out instead of the previous: 另外,在反复调整配置的同时,另一个SQLException进入了我们的视线,并开始弹出而不是先前的:

Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceDisabledException: Pool X is Suspended, cannot allocate resources to applications

Now this one is even more frustrating, because we tried everything; 现在,这更加令人沮丧,因为我们尝试了所有事情。 reset the data source; 重置数据源; delete and re-create; 删除并重新创建; delete and re-create with different name; 删除并用不同的名称重新创建; delete the domain and re-create with a different data source name; 删除域并使用其他数据源名称重新创建; go back using the dvlp DB; 返回使用dvlp DB; but nothing, the exception seems to persist. 但没有,例外似乎仍然存在。

We really don't have any idea of how to solve this and we can't go any further without fixing this problem. 我们真的不知道如何解决这个问题,并且如果不解决这个问题就无法走得更远。

We finally found how to fix the problem, but to answer the question I will have to explain more about our environment; 我们终于找到了解决问题的方法,但是要回答这个问题,我将不得不对我们的环境进行更多的解释。 We actually have two managed servers, and each application runs on another server. 实际上,我们有两个托管服务器,每个应用程序都在另一个服务器上运行。 Both the admin-server and one of the MS runs on one machine, and the other MS runs on another machine (total of two machines). 管理服务器和一个MS都在一台计算机上运行,​​另一个MS则在另一台计算机上运行(总共两台计算机)。

The thing was that when we modified one of the data sources (X), which was used also by the other MS, we didn't restarted the other MS, but only the data-source. 问题是,当我们修改一个数据源(X)时,另一个MS也使用了该数据源(X),我们没有重新启动另一个MS,而只是重新启动了数据源。 We guess that this caused the data-source not to update with the new modifications on the other MS, which caused the errors we encountered. 我们猜想这导致数据源无法使用其他MS上的新修改进行更新,从而导致我们遇到的错误。

The problem was caused by a rather foolish reason, but it was hard to spot because it recurred on any environment setup of the admin-server + first MS part, even on our own PCs with a setup of only an admin-server with no definition of machines. 该问题是由一个相当愚蠢的原因引起的,但是很难发现,因为在管理服务器+第一个MS部件的任何环境设置中都反复出现该问题,即使在我们自己的仅安装了无定义管理服务器的PC上也是如此机器。 The reason it still happened is because the address of the machine containing the other application was written in the code (read from XML configuration, but that doesn't change much). 仍然发生这种情况的原因是,包含其他应用程序的计算机的地址是用代码编写的(从XML配置中读取,但是变化不大)。

Well, glad that's over with. 好吧,很高兴那结束了。

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

相关问题 在Weblogic Server 8.13中记录SQL - Logging SQL in Weblogic Server 8.13 可以使用SqlException.LineNumber来识别异常是否与连接有关? - Can SqlException.LineNumber be used to identify whether an exception is related to connectivity? java.sql.SQLException:无法在设置自动提交的情况下回滚(JDBC with OracleConnection,Weblogic 12c) - java.sql.SQLException:Could not rollback with auto commit set on (JDBC with OracleConnection ,Weblogic 12c) 解析ASP.NET(MVC)应用程序中的SQLException错误? - parsing SQLException errors in an ASP.NET (MVC) application? System.Data.SqlClient.SqlException 与网络相关或特定于实例的错误 - System.Data.SqlClient.SqlException A network-related or instance-specific error SQL Server外部应用导致主要的CPU负担 - SQL Server outer apply causing major CPU burden 尝试连接到SQL Server数据库时出现“ SqlException未处理”错误 - 'SqlException was unhandled' error when trying to connect to SQL Server database 数据库未启动但 SQL Server 已准备好连接时的 SqlException - SqlException when the database is not started but SQL Server is ready for connections odd SQLException - 无法检索转换只读状态服务器 - odd SQLException - Could not retrieve transation read-only status server SQL Server数据库中的相关表 - Related tables in a SQL Server database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM