-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate swallows Exceptions (beforeTransactionComplete())
PostPosted: Mon Jun 04, 2012 10:39 am 
Newbie

Joined: Mon Jun 04, 2012 10:01 am
Posts: 1
We'd like to implement a basic security check that throws a SecurityException when certain objects are loaded/saved/updated/deleted during a Hibernate session.

Intended solution: Collect onLoad()/onSave()/onDelete() calls in an Interceptor, and perform the security check in beforeTransactionComplete() [it cannot be done directly in onLoad etc, because the fields of the objects aren't fully initialized there yet]

Problem: Hibernate swallows *all Throwables* in SessionImpl.beforeTransactionCompletion() [I wonder, if catching the Throwable without rethrowing is really a good idea?]

As a temporary workaround, we're performing our check postFlush() instead of beforeTransactionComplete(), but I'm not sure, if this is the correct place. Our unit tests show, that postFlush is called even if the session only loads objects, but I don't think, the behaviour is fully specified? Is there maybe a better place?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.