XA error with SQL Server and Atomikos TransactionsEssentials - sql-server

Wondering what this is about:
{
"#timestamp": "2021-12-22T07:16:00.315Z",
"log.level": "WARN",
"message": "XA resource 'xxxxxxxxDataSource': resume for XID '3137322E31382E302E322E746D313634303135373335313132343030303032:3137322E31382E302E322E746D31' raised -3: the XA resource detected an internal error",
"service.name": "xxxxx",
"process.thread.name": "main",
"log.logger": "com.atomikos.datasource.xa.XAResourceTransaction",
"error.type": "javax.transaction.xa.XAException",
"error.message": "The function START: failed. The status is: -3. Error: \" *** SQL_XA DTC_ERROR Context: DtcXaRM::GetTransactionCookie, StatusCode=-3 (0xFFFFFFFD), state=1, hr=0x8004D00E\"",
"error.stack_trace": "javax.transaction.xa.XAException: The function START: failed. The status is: -3. Error: \"*** SQL_XA DTC_ERROR Context: DtcXaRM::GetTransactionCookie, StatusCode=-3 (0xFFFFFFFD), state=1, hr=0x8004D00E\"\nat com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:652)\nat com.microsoft.sqlserver.jdbc.SQLServerXAResource.start(SQLServ erXAResource.java:766)\nat com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:297)\nat com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:40)\nat com.atomikos.datasour ce.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:46)\nat com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:70)\nat com.atomikos.datasource.xa.session.SessionHandle State.notifyBeforeUse(SessionHandleState.java:160)\nat com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:207)\nat com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:122)...snip"
}
The error snippet is from the main Spring Boot application log. SQL Server runs in a separate Docker container, and I didn't see any errors there. I've tried enabling XA support in SQL Server by running EXEC sp_sqljdbc_xa_install, as instructed here.
Can't tell if it worked, but it didn't produce any errors either.
The runtime stack contains Atomikos TransactionsEssentials 4.0.6, Mssql-jdbc 6.4.0.jre, SQL Server 2019, and Hibernate 5.3.15.Final.

Related

R2DBC-MSSQL how to connect to a database

I am trying to connect to my local SQL Server with R2DBC, unfortunately, I do not know where I am going wrong, I have a lot of experience with R2DBC, I use it all the time with other databases but this is my first time with MSSQL, below is my MSSQL ConnectionFactorythat is failing:
#Bean
override fun connectionFactory(): ConnectionFactory {
val options = builder()
.option(DRIVER, "sqlserver")
.option(HOST, properties.host)
.option(PORT, properties.port.toInt())
.option(USER, properties.username)
.option(PASSWORD, properties.password)
.option(DATABASE, properties.database)
.option(SSL, false)
.build()
val connectionFactory = ConnectionFactories.get(options)
val configuration = ConnectionPoolConfiguration.builder(connectionFactory)
.maxIdleTime(Duration.ofMillis(1000))
.maxSize(20)
.build()
connectionPool = ConnectionPool(configuration)
return ProxyConnectionFactory.builder(connectionPool)
.build()
}
My properties
com:
#Application database
database:
host: PC_NAME\SQLEXPRESS
port: 51306
database: app_database
username: user
password: pass
When I run my application I get the error below:
09:02:40.151 [reactor-tcp-nio-1] DEBUG reactor.pool.SimpleDequePool - failed to warm up extra resource 9/9: java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
09:02:40.153 [parallel-2] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.transaction.CannotCreateTransactionException: Could not open R2DBC Connection for transaction; nested exception is java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open R2DBC Connection for transaction; nested exception is java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
I do not understand where I am going wrong, I can confirm that I have enabled TCP and shown below
And enabled remote connection on my server instance
Does anyone know how this works?

Unhandled Java exception: com.microsoft.sqlserver.jdbc.SQLServerException connecting to Sql Server from Linux Server usingJruby

I am trying to connect to MS SQL Server Database using jruby on Linux server.
This is how my code looks like:
require 'rubygems'
require 'java'
require '/home/testuser/sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar'
Java::com.microsoft.sqlserver.jdbc.SQLServerDriver
url = 'jdbc:sqlserver://myremotedb.test.com:19263;databaseName=testappdatabase'
connection = java.sql.DriverManager.get_connection(url, 'testuser1', 'testpass1')
testconn = conn.createstatement
When i do this, I am getting the following error:
Unhandled Java exception: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'CORP/infautomic'. ClientConnectionId:ef4f1526-86d3-4e31-a3a8-31c1b026ac4b
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'testuser1'. ClientConnectionId:ef4f1526-86d3-4e31-a3a8-31c1b026ac4b
makeFromDatabaseError at com/microsoft/sqlserver/jdbc/SQLServerException.java:216
onEOF at com/microsoft/sqlserver/jdbc/tdsparser.java:254
parse at com/microsoft/sqlserver/jdbc/tdsparser.java:84
sendLogon at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2908
logon at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2234
access$000 at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:41
doExecute at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2220
execute at com/microsoft/sqlserver/jdbc/IOBuffer.java:5696
executeCommand at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1715
connectHelper at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1326
login at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:991
connect at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:827
connect at com/microsoft/sqlserver/jdbc/SQLServerDriver.java:1012
getConnection at java/sql/DriverManager.java:664
getConnection at java/sql/DriverManager.java:247
invoke at java/lang/reflect/Method.java:498
invokeDirectWithExceptionHandling at org/jruby/javasupport/JavaMethod.java:483
invokeStaticDirect at org/jruby/javasupport/JavaMethod.java:375
invokeOther17:get_connection at sqljdbc.rb:7
<main> at sqljdbc.rb:7
invokeWithArguments at java/lang/invoke/MethodHandle.java:627
runScript at org/jruby/Ruby.java:827
runNormally at org/jruby/Ruby.java:746
runNormally at org/jruby/Ruby.java:764
runFromMain at org/jruby/Ruby.java:577
doRunFromMain at org/jruby/Main.java:417
internalRun at org/jruby/Main.java:305
run at org/jruby/Main.java:232
main at org/jruby/Main.java:204
How can i fix this?

Unable to run Application Module Tester in Jdev 12c

Using MySQL DB, I made some EO and VO's in Jdev 12c - 12.2.1.0.0.
When I right click on AM and run, then it shows the following error
oracle.jbo.jbotester.app.ErrorHandler$ExceptionWrapper: JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:108)
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:94)
at oracle.jbo.jbotester.app.IErrorHandlerImpl.displayError(IErrorHandlerImpl.java:43)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:513)
Caused by: oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:218)
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:45)
at oracle.jbo.server.ConnectionPoolDataSource.getConnection(ConnectionPoolDataSource.java:75)
at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:999)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1184)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:7115)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:297)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:328)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:643)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:439)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9909)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4538)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2453)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2263)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3162)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:604)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:537)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:532)
at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:644)
at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:1017)
at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:100)
at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:1054)
at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:697)
at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:674)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:501)
## Detail 0 ##
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:218)
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:45)
at oracle.jbo.server.ConnectionPoolDataSource.getConnection(ConnectionPoolDataSource.java:75)
at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:999)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1184)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:7115)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:297)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:328)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:643)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:439)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9909)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4538)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2453)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2263)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3162)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:604)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:537)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:532)
at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:644)
at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:1017)
at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:100)
at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:1054)
at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:697)
at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:674)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:501)
The same runs fine in Jdev 11g.
A similar question was there in Oracle ADF community but it is not answered
Did you test your database connection before running the AppModule?

Etherpad - PostgreSQL error: language "plpgsql" does not exist

I installed Etherpad lite and tried to use it with PostgreSQL database, but got this error:
events.js:72
throw er; // Unhandled 'error' event
^
error: language "plpgsql" does not exist
at Connection.parseE (/opt/openerp/etherpad/etherpad-lite/src/node_modules/$
at Connection.parseMessage (/opt/openerp/etherpad/etherpad-lite/src/node_mo$
at Socket.<anonymous> (/opt/openerp/etherpad/etherpad-lite/src/node_modules$
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
RESTART!
In other servers I didn't have such problem using PostgreSQL with Etherpad.
I created database using this command:
crate database etherpad WITH TEMPLATE template0;
My configuration in etherpad is like this:
"dbType" : "postgres",
"dbSettings" : {
"user" : "db_user",
"host" : "localhost",
"password": "my_password",
"database": "etherpad"
},
Everything else is left unchanged, except I commented dirty db settings.
P.S. with dirty db it works.
If you are using 9.1 and below, you should CREATE LANGUAGE plpgsql in template1, and then create your database based on that template. This should not happen or be required on PostgreSQL 9.2 and above.

Weblogic - Received exception while creating connection for pool: "mds-SpacesDS": Socket read timed out

I am upgrading Oracle middleware suite from 11.1.2 to 11.1.3. When creating my weblogic domain, come to the step of testing database schema connections, it works fine (I have upgraded DEV_SOAINFRA to 11.1.3).
However, when I start my weblogic admin server, I have this error : Received exception while creating connection for pool: "mds-SpacesDS": Socket read timed out.
The part of the log file is:
<[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <1279769964111> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <1279769964112>
java.sql.SQLException: Socket read
timed out at
oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
at
oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:135)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:203)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:489)
at
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:439)
at
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:640)
at
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:205)
at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1117)
at
weblogic.common.resourcepool.ResourcePoolImpl.recreateDeadResources(ResourcePoolImpl.java:2067)
at
weblogic.common.resourcepool.ResourcePoolImpl.access$1000(ResourcePoolImpl.java:40)
at
weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2442)
at
weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused By: oracle.net.ns.NetException:
Socket read timed out at
oracle.net.ns.Packet.receive(Packet.java:333)
at
oracle.net.ns.NSProtocol.connect(NSProtocol.java:267)
at
oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1076)
at
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:303)
at
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:640)
at
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:205)
at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1117)
at
weblogic.common.resourcepool.ResourcePoolImpl.recreateDeadResources(ResourcePoolImpl.java:2067)
at
weblogic.common.resourcepool.ResourcePoolImpl.access$1000(ResourcePoolImpl.java:40)
at
weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2442)
at
weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
It seems that weblogic can't connect to the schema mds_spacesDS. I am, however, able to manually connect to the Database schema without any problem.
Does anyone encounter it before?
Khue.
I bit late but did you see this
http://forums.oracle.com/forums/thread.jspa?threadID=1102140

Resources