Hibernate Search 421 [Exceptions happening in backend are unnoticed]
by Amin Mohammed-Coleman
Hi All
Emmanuel asked me to look at this issue (HSearch 421) where exceptions
happening in backend process which are going unnoticed. I was wondering if
I could get some advice/thoughts on how to tackle the problem. The issue
mentioned providing the user the option to decide how to handle exceptions
(for example queues, logs, etc), so I'm guessing there needs to be some
custom option that the user will need to set up, maybe something like this?
exception_handling_strategy=jms
exception_handling_strategy_jms_queue=
or if they wanted to log the exceptions:
exception_handling_strategy=log
or the user could create a custom class which implements a particular
interface to handle exceptions
exception_handling_strategy=custom
exception_handling_custom_class=ExceptionHandling
I could be completely wrong in the above approach and therefore would be
grateful for any input.
Cheers
Amin
14 years, 9 months
Jira migration
by Steve Ebersole
Just a heads up that atlassian will be performing a data migration of our Jira data into the new Jira Studio they and Contengix have set up for us. I do not yet know the exact date time but will let everyone know as I hear the details
-- Sent from my Palm Pre
steve(a)hibernate.org
http://hibernate.org
14 years, 10 months
Problems building Core
by Hardy Ferentschik
Hi,
just wondering whether someone could confirm that the reactor build of
Core is broken.
There is a sort of expected failure in
EmbeddedTypeTest.testSingularAttributeAccessByNameFailureExpected
in the entitymanager module. But even after commenting out this test I am
not able to complete the build.
I am having problems with the Envers test suite where I am getting an
OutOfMemoryError:
org.apache.maven.surefire.booter.SurefireExecutionException: Java heap
space; nested exception is java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
at
java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
at java.lang.StringBuffer.append(StringBuffer.java:225)
at
org.testng.reporters.SuiteHTMLReporter.generateMethodsChronologically(SuiteHTMLReporter.java:429)
at
org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:67)
at org.testng.TestNG.generateReports(TestNG.java:735)
at org.testng.TestNG.run(TestNG.java:721)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
--Hardy
14 years, 10 months
EMF / EM properties
by Steve Ebersole
There have been a few discussions on IRC about handling getProperties()
& setProperty(..) handling in regards to the EMF and EM. I wanted to
expand this discussion here so that:
1) we get a broader audence/participation;
2) we get a record of the discussion :)
We have to consider 2 axes if you will, the first being the availability
of a particular setting for EM versus EMF and the second being JPA
defined settings versus "vendor specific" settings. For Hibernate, the
vast majority of "vendor specific" settings are available already from
org.hibernate.cfg.Environment; those happen to be EMF/SF specific for
the most part.
We've added others in the new org.hibernate.ejb.AvailableSettings. This
is a mix of JPA defined settings plus some additional
Hibernate-EM-specific settings. I like the idea of
org.hibernate.ejb.AvailableSettings specifically because it consolidates
all the setting names in a single place.
On Friday on IRC Hardy and I began discussing the idea of "Setting"s as
an internal contract that describes how a setting is applied. Take the
case of EM, there we'd have a series of named Settings that are specific
to EM. We described a pretty simplistic interface, something like:
interface EntityManageSetting {
public void apply(SessionImplementor session, Object value);
public Object determineValue(SessionImplementor session);
}
Then the pseudo-code for EM.setProperty becomes:
public void setProperty(String name, Object value) {
final EntityManageSetting setting = getSetting( name );
if ( setting != null ) {
// recognized setting
setting.apply( getSessionImplementor(), value );
}
//else {
// setting was not recognized, ignore per spec
//}
}
The EntityManager impl would then have a set of settings:
private static Map<String name,EntityManageSetting> settingHandlers
= new ConcurrentHashMap<String name,EntityManageSetting>();
static {
settingHandlers.put(
SHARED_CACHE_RETRIEVE_MODE,
new EntityManagerSetting() {
...
}
);
...
}
And something similar for EMF.
One thing I did not see an answer for is how changes to a EMF setting is
supposed to affect an existing EM. Take cache-store-mode; consider:
EntityManagerFactory emf = ...;
emf.setProperty(
"javax.persistence.cache.storeMode",
CacheStoreMode.BYPASS
);
EntityManager em = emf.createEntityManager();
// Now, by spec em should behave as CacheStoreMode.BYPASS because
// the store mode is not overridden on it
.setProperty(
"javax.persistence.cache.storeMode",
CacheStoreMode.USE
);
// Now what cache-store-mode is in effect for the em?
// Intuitively I think CacheStoreMode.BYPASS makes the most sense,
// but the spec does not say one way or the other that I saw.
--
Steve Ebersole <steve(a)hibernate.org>
Hibernate.org
14 years, 10 months
Git repo
by Steve Ebersole
Just wanted to point out that I enabled the Git repo capability within
SourceForge. There is no plan to move Hibernate itself to this (or any)
Git repo. I enabled it mainly just as a chance for use to play with Git
capabilities on "sandbox" type stuff.
See https://sourceforge.net/scm/?type=git&group_id=40712 for details.
If you browse the Git repo
( http://hibernate.git.sourceforge.net/git/gitweb-index.cgi ), you'll
see the (currently) 2 repos:
* /hibernate - is the main one intended to hold the project source
created by SourceForge when I enabled Git.
* /junit4-prototype - is an example of the "sandbox style repo I
mentioned. I created it to track some work I am doing in prototyping a
move to JUnit 4 obviously :P But also because I wanted try out Git and
play around with it.
If you'd like to create a repo also (those with developer access),
follow the instructions at
https://sourceforge.net/apps/trac/sourceforge/wiki/Git#CreatingMultipleRe...
--
Steve Ebersole <steve(a)hibernate.org>
Hibernate.org
14 years, 10 months
Reminder beta-4 tomorrow
by Steve Ebersole
Just a reminder that tomorrow will be beta-4. If anyone has anything that they absolutely want to get in lets chat on irc and we can plan exact times. My pref is to start early.
-- Sent from my Palm Pre
steve(a)hibernate.org
http://hibernate.org
14 years, 10 months
(no subject)
by Steve Ebersole
Just a reminder that tomorrow will be beta-4. If anyone has anything that they absolutely
-- Sent from my Palm Pre
steve(a)hibernate.org
http://hibernate.org
14 years, 10 months
Hibernate EntityManager test speed
by Emmanuel Bernard
Hi Maven gurus,
Is there a way to make mvn test runs faster for entitymanager?
It seems that the vm is forked for every test. While I understand the need for the "packaging" tests, most tests don't require such forking and could be executed much faster.
I don't know if that's possible but that would be nice.
Emmanuel
14 years, 10 months
org.hibernate.PropertyValueException: not-null property references a null or transient value
by Claude Houle
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello All,
I've been tracking an issue that has been causing us some trouble
regarding annotation-based hibernate mappings. The exception occurs at
run-time only:
/org.hibernate.PropertyValueException: not-null property references a
null or transient value ...
/
At first I believed we had an issue with our entity mapping was faulty
and went to try and figure it out... However, I came accross several
examples on the wide internet and showed that my mapping seems
correct. Furthermore, I had some other entities mapped in a similar
fashion that did not cause any issue... How could that be?
I traced the Hibernate code to a class named
org.hibernate.cfg.OneToOneSecondPass (Hibernate Annotations 3.4.0.GA
for those interested to look at the code) up to line 147:
...
Iterator it = otherSide.getJoinIterator();
Join otherSideJoin = null;
while ( it.hasNext() ) {
otherSideJoin = (Join) it.next();
if ( otherSideJoin.containsProperty( otherSideProperty ) ) {
break;
}
}
if ( otherSideJoin != null ) {
...
}
...
If you look closely, it seems that if there are JOINs but none
contains the otherSideProperty, the variable otherSideJoin will not be
null and will contains the last joins of the iterator even if it is
not valid.
The patched-up code would look like:
...
Iterator it = otherSide.getJoinIterator();
Join otherSideJoin = null;
while ( it.hasNext() ) {
Join otherSideJoinValue = (Join) it.next();
if ( otherSideJoinValue.containsProperty( otherSideProperty ) ) {
otherSideJoin = otherSideJoinValue;
break;
}
}
if ( otherSideJoin != null ) {
...
}
...
To fix my issue, I applied this patch:
Index: src/main/java/org/hibernate/cfg/OneToOneSecondPass.java
===================================================================
- --- src/main/java/org/hibernate/cfg/OneToOneSecondPass.java
(revision 18572)
+++ src/main/java/org/hibernate/cfg/OneToOneSecondPass.java
(working copy)
@@ -146,8 +146,9 @@
Iterator it = otherSide.getJoinIterator();
Join otherSideJoin = null;
while ( it.hasNext() ) {
- - otherSideJoin = (Join) it.next();
- - if ( otherSideJoin.containsProperty(
otherSideProperty ) ) {
+ Join otherSideJoinValue = (Join) it.next();
+ if ( otherSideJoinValue.containsProperty(
otherSideProperty ) ) {
+ otherSideJoin = otherSideJoinValue;
break;
}
}
I compiled the code locally and re-tried my failing code and it worked
beautifully. it seemed that my last joins in the iterator has a
nullable = false which caused the runtime
/org.hibernate.PropertyValueException: not-null property references a
null or transient value/
In all honesty, there are plenty of existing bug-reports where this
particular issue could fit:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4344
http://opensource.atlassian.com/projects/hibernate/browse/ANN-556
Thanks,
- --
Claude Houle
8D Technologies inc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAktZ2S8ACgkQlk+F7nx+VYtQHQCgp4EH1Ey0h/kbMbeE7hCUJBLG
broAnAgq3ZuMC79MlN9njfR8x9yK05R1
=7xV5
-----END PGP SIGNATURE-----
14 years, 10 months