Reputation: 740
I am trying to run a web application with the result that it's not able to process further. So it seems it is "locked" somehow (It stayes at the "Start in progress..."-process until it crashes).
After thinking about what could be the cause, I remembered that I didn't stop a transaction.
I just entered the command
entityManager.getTransaction().begin();
but haven't stopped or closed the transaction.
So my question is:
Do transactions stop after the program got closed? And if not, do you know how I can stop the transaction the easiest way?
PS: Please correct every grammar-mistake I've made - I just like questions which are beautifully formulated.
Upvotes: 0
Views: 201
Reputation: 73558
The database is going to see a connection being closed, so the transaction is definitely going to end. What's not defined is whether the transaction is committed or rolled back.
If I'm not mistaken the more popular option is to rollback any uncommitted transactions (after all it indicates that something's gone wrong and you'd prefer a rollback), but this can depend on the database being used.
Upvotes: 1