Saturday, August 26, 2017

nested exception is org.springframework.transaction.CannotCreateTransactionException

If you are java developer and using Spring and Hibernate to develop application, you might have faced this exception sometime during the development process. The exception gives a 500 internal server and the error message will be something like the one mentioned below.
HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException
If you check the stack trace of the error you may fight the line of the code that is responsible for the exception.

Cause:

As the exception show it was not able to perform the transaction, means there is some issue either in the code, or in the database that is failing the transaction.

Solution:

So, what could be reason for the transaction failure or creation? Check if all your transaction was getting failed for different tables on different pages. If the answer is yes, then follow the following steps to find out the issue.
1.       Check if your database server is up and running. If the database server is down, your application could not connect to database. Hence transaction creation will be failed. If the database is up and still facing the same issue follow the next step below.
2.       Check database credential you are using to connect to server. I mean the username, password for the database.  Make sure you have the correct and updated database username and password. If your application was working with the existing username and password and not working, check with your database admin if the credential had been changed.


The above steps will help you to resolve the following issue. In case if you still facing the issue comment on the post with details. I will try to get back to you

No comments:

Post a Comment