Exceptions thrown in a tx synchronization are eaten
by Adam Warski
Hello,
if a transaction synchronization throws an exception, is it only logged, and not thrown further (see org.hibernate.transaction.JDBCTransaction, line 273). Is there some reason for this?
As Envers uses tx synchronizations quite extensively, when an exception is thrown in the synchronization, I roll back the transaction manually. So, no data is persisted (which is the desired behavior), but the client isn't notified in any way that something went wrong; for the client, the operation behaves as if the tx commited successfully.
I suspect that maybe some applications rely on the fact that the exception is eaten and not re-thrown. If there are no contra-arguments to throw the exceptions, maybe a good solution would be to re-throw the exception is the transaction is already marked for rollback? Or if it was marked for rollback in the synchronization?
The related JIRA issues are:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3543
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4721
By the way, how does Hibernate Search deal with such situations? I looked at PostTransactionWorkQueueSynchronization, and it seems that it's possible that the transaction commits, but the data isn't indexed properly, if the queueingProcessor.performWorks throws an exception?
--
Adam Warski
http://www.warski.org
http://www.softwaremill.eu
14 years, 5 months
hibernate. vs org.hibernate. for properties prefix
by Emmanuel Bernard
On Hibernate EntityManager:
- AvailableSettings#ALIAS_SPECIFIC_LOCK_MODE (org.hibernate.lockMode)
- AvailableSettings#FLUSH_MODE (org.hibernate.flushMode)
are the only two properties starting with org. instead of hibernate. for the rest of the properties.
It would make sense to align them to "hibernate.". What is going to be impacted? Last time I did such a move, I broke the TCK, so better ask first this time :)
14 years, 9 months
the raise of the new spammer generation
by Sanne Grinovero
Hi all,
as I mentioned recently, it often happens that new forum accounts are
made and write something "quite relevant" to the topic, sometimes just
one post, sometimes one in each subforum.
This "quite relevant posts" are obviously generated by some clever
bot. I delete them, but have to admit that I'm not always 100% sure
that I'm not deleting a human written post, as the wording is often
coherent with the topic, and we can't require to write in perfect
English.
They always have some links in the footer to buy nice stuff, like new
Nike shoes and similar, and I see now that in the admin panel we could
disable "Allow use of links in user signatures",
any thoughts?
Cheers,
Sanne
14 years, 9 months
[HV] Supporting Joda Time API with @Past/@Future
by Gunnar Morling
Hi,
for Hibernate Validator 4.1 we are planning to add some new constraints. In
this context Hardy and I discussed whether it might be worth to add support
for the date/time types from the Joda Time API (
http://joda-time.sourceforge.net/) for the @Past/@Future standard
constraints.
I think Joda is quite popular these days, and the upcoming JSR 310 is
heavily influenced by Joda, too (the spec lead is also the lead of Joda). So
this might add value for users, OTOH such support might be too specific. Are
there any opinions on this?
Thanks, Gunnar
14 years, 9 months
Re: [hibernate-dev] Hibernate Search 421
by Sanne Grinovero
Hi Amin,
thanks to you, and sorry for the delay.
I've committed a first step that you obviously need - indipendently
from how we manage it - please see:
http://fisheye.jboss.org/changelog/Hibernate/search?cs=18939
So this should simplify your patch having impact only on the exception
handling strategy.
I have to ask you one more change: could you avoid this enum? It
doesn't feel right to use this hack to achieve a singleton, and
storing state in it doesn't make me feel right: you could have more
than one Search application configured in different ways and these are
going to affect each other when using an enum configuration. Besides
that, you would enter in thread visibility issues which is a pain to
manage (the initialization of the enum would need synchronization and
other issues like that).
Emmanuel are you ok with this if we either log or rethrow the
exception back to application code? jms et al looks complex and I
don't see the benefit.
Sanne
2010/3/1 Amin Mohammed-Coleman <aminmc(a)gmail.com>:
> Hi Sanne
>
> Thanks for the feedback. Please find attached the updated patch with your initial recommendations. Sorry about the formatting issues with the original patch.
>
>
> Cheers
> Amin
>
>
>
> On 28 Feb 2010, at 23:11, Sanne Grinovero wrote:
>
>> Hi Amin,
>> thanks for the patch; it's a bit late now so I'll look into the
>> details in the next days; some early feedback:
>>
>> 1)Could you update the patch to avoid whitespace reformatting changes?
>> It looks like your IDE reformatted some methods and import statements
>> which appear unchanged code, this makes it a bit hard to review.
>>
>> 2)About the code in SearchFactoryImpl, make sure the line
>> "initialiseBackendExceptionConfiguration(cfg);"
>> happens before the write to the barrier (I mean: replace positions
>> with the line above it, the code "this.barrier = 1;" should be the
>> last one in the method).
>>
>> 3)Executors.newFixedThreadPool:
>> if it's a fixedThreadPool the min and max should always be the same
>> value, so either use just one parameter or change the method name.
>>
>> 4) You're loading the custom strategy by reflection in
>> BackendExceptionHandler; that's fine but if you could use the
>> org.hibernate.search.util.PluginLoader utility you'd be sure to use
>> the right classloader and benefit from improved error messages in case
>> of exceptions.
>> Method signature is scary but look at other usages for some examples.
>>
>> thank you for all the help,
>> Sanne
>>
>> 2010/2/25 Amin Mohammed-Coleman <aminmc(a)gmail.com>:
>>> Hi Guys
>>>
>>> Sorry for the delay with this. I've been pretty tied up with the new job and also tried looking at doing this from various angles. Please find attached a patch which is more of a POC and I wanted to get your thoughts (and criticisms!). The coding is more in line with Sanne's recommendation that is because I tried looking at implementing something that you suggested Emmanuel but I'm afraid I got stuck.
>>>
>>> You'll come across a class BackendExceptionHandler which I'm not very happy about but I wanted to get something together to get a discussion.
>>>
>>> Again apologies for the delay.
>>>
>>>
>>> Cheers
>>> Amin
>
>
>
14 years, 9 months
mvn clean install on core root, some doc resource issue
by Emmanuel Bernard
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unexpected problem
Embedded error: Problem performing 'transformation'
Server returned HTTP response code: 403 for URL: http://www.oasis-open.org/docbook/xml/4.5/dbhierx.mod
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
14 years, 9 months