JBoss EAP datasource migration to AWS JDBC Wrapper #217
Replies: 14 comments 8 replies
-
Hello @pexa-araza Thank you for reaching out! I'd suggest to use the following configurations for AWS JDBC Driver. Writer
Reader
Depending on your application workflows and usual SQL statements you may consider to replace Thank you! |
Beta Was this translation helpful? Give feedback.
-
Thank you. Now after updating everything and running the application, the log is full of the following error message: 2022-10-14 15:05:56,285 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (pexa-threads task-4004) Transaction resolution unknown. Please re-configure the session state if required and try restarting the transaction. The application currently uses dedicated Aurora Writer and Replica with their own cluster endpoints. Previously without postgres jdbc driver, we did not see this message/error. Please note that the application is configured to use Spring AbstractRoutingDataSource and updates the data source at runtime, based on Spring's read-only transaction annotation. Although, the application is working fine but getting the above error message is concerning and is a blocker for production implmentation. Could you please suggest what need to be done to fix the above? Thanks |
Beta Was this translation helpful? Give feedback.
-
@pexa-araza The error messages are telling you that the driver detected a failover. |
Beta Was this translation helpful? Give feedback.
-
Hi @pexa-araza, in addition to @davecramer's comment, would you also be able to provide us with the full logs? Thank you. |
Beta Was this translation helpful? Give feedback.
-
Interestingly there is no database failover as I can't see anything on AWS RDS Console regarding failover. or driver detects a different kind of failover? JBoss EAP Data Sources:
Logs:
|
Beta Was this translation helpful? Give feedback.
-
In the short term I would recommend removing the We need to catch the exceptions the driver throws when failover occurs and transform them into new exceptions. Your code will have to deal with them appropriately when they are thrown. |
Beta Was this translation helpful? Give feedback.
-
Based on the logs it seems the driver has detected a network-related SQLException: It is hard to tell what caused the network-related SQLException that triggered the failover process in the first place from the logs. |
Beta Was this translation helpful? Give feedback.
-
@pexa-araza How are you adding aws jdbc wrapper jar to the datasource defination in standalone-openshift.xml? |
Beta Was this translation helpful? Give feedback.
-
See above for the data source defined in JBoss EAP. along with the datasources, you'll need to update the datarouces's driver as
also see attached screenshot of the modules |
Beta Was this translation helpful? Give feedback.
-
Hi, In our Spring boot application which is running on Java 1.8, we are getting the exception ->java.sql.SQLException: No suitable driver Following is the config:
Added the dependency in pom.xml:
Logs
|
Beta Was this translation helpful? Give feedback.
-
Hi @SamuelChirra Yes, you need to also add the PostgreSQL driver to the dependencies.
|
Beta Was this translation helpful? Give feedback.
-
Sorry, it took us long to conduct the testing with AWS JDBC Wrapper after the above suggestion. We have now concluded the tests. Please find attached the test results for Failover testing. Unfortunately, the test failed compared to our previous test without the AWS JDBC driver. The application didn't recover from failover even after 30 minutes and the log was full of Transaction Resolution Unknown errors. |
Beta Was this translation helpful? Give feedback.
-
@pexa-araza can you share the PostgreSQLValidConnectionChecker class ? |
Beta Was this translation helpful? Give feedback.
-
thx, I actually meant PostgreSQLExceptionSorter but I found that one too. Thanks for the information. |
Beta Was this translation helpful? Give feedback.
-
In our JBoss application, we currently have got two data sources defined
1. Writer
How would the above two configurations be translated to AWS Advanced JDBC Wrapper along with the failover plugin?
Thank You
Beta Was this translation helpful? Give feedback.
All reactions