Skip to content

Conversation

@bvarner
Copy link
Contributor

@bvarner bvarner commented Apr 20, 2012

This issue is only testable when the database dialects throw the proper Hibernate Exception type for SQL Errors generated by lock timeouts.

Unfortunately, adding this test case exposes that most of the database dialects in Hibernate are not mapping SQL Errors for timeouts properly.

There are a few exceptions.

  • This patch corrects the behavior for H2, and cleans up the handling for PostgreSQL.
  • Oracle and Derby probably work, but I do not have the resources locally to verify these. The code for handling Oracle & Derby timeouts may need to be moved from SQLStateConversionDelegate into delegates provided by the dialects (if the codes really are vendor / dialect specific). There is also some code-smell in the SQLStateConversionDelegate regarding QueryTimeoutExceptions for MySQL and Oracle that may be appropriate to move as well.

I've been talking with sebersol on freenode the last few days about this, and was instructed to go ahead and make this pull request. If I had access to the RedHat test systems I would have already addressed these issues. I expect this request to cause some matrix tests to start failing. I will be happy to assist in fixing those (and the dialects which fail) if I can somehow get access to the logs for the failures (which should have the JDBCException dumps with the proper error states for each dialect).

bvarner added 13 commits April 17, 2012 13:40
…or Deadlock / lock timeout (not available with NOWAIT query).
The code was a bit non-obvious (assignment in a method call argument) where it was being done, and the local variable (lockOptions) assignment was missing in the find() method implementation.
I changed all instances of lockOptions assignment to assign before the method call where it's required as an argument, ensuring proper scope for exception mapping.
…tly fails for PostgreSQL matrix tests, unless HHH-7251 is also applied.
… thrown. This feels sooo wrong.

I know dialects aren't mapping lock exceptions properly, and this test case exposes that if you fail the test when PersistenceException is thrown. So what do I do now?

There are other tests in this very test class that don't fail the build when the wrong exception is thrown, even though they clearly should.
… I was doing more than I needed to.

Updated the LockTest to enable another nowait test for postgresql.
@sebersole
Copy link
Member

For future reference, we do not merge master into topic branches. Merging creates ugly "merge commits" that make the project history go all spaghetti. I will try to fix this for this pull request...

@sebersole
Copy link
Member

Ok, I was able to weed out the merge commits. In the future, please use rebasing to keep your changes contiguous at the end of history.

@sebersole sebersole closed this May 2, 2012
@bvarner
Copy link
Contributor Author

bvarner commented May 3, 2012

Sorry about that. I'm new to git...

On Wed, May 2, 2012 at 6:37 PM, Steve Ebersole <
reply@reply.github.com

wrote:

Ok, I was able to weed out the merge commits. In the future, please use
rebasing to keep your changes contiguous at the end of history.


Reply to this email directly or view it on GitHub:
#317 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants