TransactionException

81 views
Skip to first unread message

davidp4web

unread,
Mar 26, 2009, 2:09:52 PM3/26/09
to Hibernate Shards Dev
Hi All,

First the good news ... :-)

I've been using hibernate shards in a test environment under load and
it performs quite respectably when compared with non-sharded
hibernate.

As the load has increased, I see (and expect)
StaleObjectStateException, which I handle by re-running the
transaction. I know this from running non-sharded. However, when I
run sharded, I don't see any exceptions except the following ...

java.lang.NoSuchMethodError: org.hibernate.TransactionException.<init>
(Ljava/lang/String;Ljava/lang/Exception;)V
at
org.hibernate.shards.transaction.ShardedTransactionImpl.commit
(ShardedTransactionImpl.java:138)
at mystuff ...

From stepping through the code, this results when an underlying
exception is handled, at the point where said exception is wrapped in
a TransactionException.

if (commitException) {
commitFailed = true;
afterTransactionCompletion(Status.STATUS_UNKNOWN);
throw new TransactionException("Commit failed",
firstCommitException); <-- line 138
}

My first thought was that there must be a version incompatibility
problem, where hibernate-shards was attempting to instantiate a
TransactionException using a constructor that is not supported in the
hibernate version I'm using. However, in my IDE I can see
TransactionException with the requisite constructor. When I try to
step from line 138 into the TransactionException constructor, it's
game over.

My hibernate3-3.3.1.jar and source code both came from hibernate-
distribution-3.3.1.GA, so I'm fairly confident I'm executing the code
I'm looking at. ;-)

I'm using hibernate-shards-3.0.0.Beta2.jar.

Ideas?

David

Max Ross

unread,
Mar 27, 2009, 1:00:49 AM3/27/09
to hibernate-...@googlegroups.com
On Thu, Mar 26, 2009 at 11:09 AM, davidp4web <davidcpe...@gmail.com> wrote:

Hi All,

First the good news ... :-)

I've been using hibernate shards in a test environment under load and
it performs quite respectably when compared with non-sharded
hibernate.
Great! 

As the load has increased, I see (and expect)
StaleObjectStateException, which I handle by re-running the
transaction. I know this from running non-sharded.  However, when I
run sharded, I don't see any exceptions except the following ...
Shards depends on Hibernate 3.2, so it's not surprising that there are some api changes that break things at runtime.  Getting it working on 3.3 shouldn't be hard, but unfortunately that's not something I'll have time to pursue for at least a month or so.  However, I'd be happy to support you in this effort it you're interested in taking it on yourself.  Let me know. 

David Pellegrini

unread,
Mar 27, 2009, 1:10:38 PM3/27/09
to hibernate-...@googlegroups.com
Hi Max,

Thanks for your response.

Max Ross wrote:
> Shards depends on Hibernate 3.2, so it's not surprising that there are
> some api changes that break things at runtime.

OK, that's what I need to know.


> Getting it working on 3.3 shouldn't be hard, but unfortunately that's
> not something I'll have time to pursue for at least a month or so.
> However, I'd be happy to support you in this effort it you're
> interested in taking it on yourself. Let me know.

I'd be interested in doing that, but right now I'm straining for the
finish line on a high-profile release.
I will fall back to Hibernate 3.2 in the meantime.

Cheers!

David

Max Ross

unread,
Mar 27, 2009, 1:17:44 PM3/27/09
to hibernate-...@googlegroups.com
If falling back to 3.2 is a reasonable option for you then that's definitely a good decision.
Reply all
Reply to author
Forward
0 new messages