[OGM] Demarcating units of work
by Gunnar Morling
Hi,
When talking to people about OGM, there is always that awkward moment when
you need to explain that TX demarcation is required also for
non-transactional data stores.
While it makes sense for our purposes (we use the "TX cycle" to optimise
the work sent to the backend etc.), I can understand people who find that
odd API-wise. So I was thinking about how this could be improved.
When it comes to CDI, a more "neutral" annotation (and a portable extension
examining it) than @Transactional …
[View More]could be helpful:
@UnitOfWork
public void saveOrderAndCustomer(Order order, Customer customer) {
session.persist( order );
session.persist( customer );
}
By means of the @UnitOfWork annotation it would be expressed that the
entire method should run as one "transaction". This also could be used to
specify an error handler for our new API to be applied for this unit of
work:
@UnitOfWork(errorHandler=FailedOpsLoggingHandler.class)
public void saveOrderAndCustomer(Order order, Customer customer) { ... }
In non-managed environments, Java-8-style Lambda expressions could be
leveraged nicely to achieve the same:
session.runUnitOfWork( () -> {
session.persist( order );
session.persist( customer );
};
This should feel much nicer to e.g. users of the MongoDB backend than
invoking session.getTransaction().begin()/commit(). It also plays greatly
together with the error handling stuff:
session.buildUnitOfWork( () -> {
session.persist( order );
session.persist( customer );
} )
.onFailedGridDialectOperation( context -> {
// e.g. log failed op
return ErrorHandlingStrategy.ABORT;
} )
.onRollback( context -> {
// e.g. log applied ops
} )
.run();
Of course something equivalent could be done for Java 7, but it'd probably
look not as concise.
Any thoughts?
Cheers,
--Gunnar
[View Less]
9 years, 11 months
Re: [hibernate-dev] Another pull request for supporting Infinispan 7.2.1 in 4.3
by Gail Badner
Adding hibernate-dev.
No, I did not have a chance to read up on what you suggested. I sounded like it had some limitations that would not work, but maybe I misunderstood. I'll look into it today.
The last couple of days have been very long. Sorry for the oversights.
----- Original Message -----
> From: "Steve Ebersole" <steve(a)hibernate.org>
> To: "Gail Badner" <gbadner(a)redhat.com>
> Cc: "Sanne Grinovero" <sanne(a)hibernate.org>, "Scott Marlow" <smarlow(a)…
[View More]redhat.com>, "Galder Zamarreño"
> <galder(a)redhat.com>
> Sent: Wednesday, May 13, 2015 5:33:24 AM
> Subject: Re: Another pull request for supporting Infinispan 7.2.1 in 4.3
>
> On May 13, 2015 7:32 AM, "Steve Ebersole" <steve(a)hibernate.org> wrote:
> >
> > 1) This really should be a hibernate-core discussion
>
> I meant to say hibernate-dev...
>
> > 2) I already suggested using forced version in Gradle and gave you a link
> on how that works. Did you read it? Did you try it?
> >
> > On May 13, 2015 2:04 AM, "Gail Badner" <gbadner(a)redhat.com> wrote:
> >>
> >> Sanne, Scott, and I discussed how Hibernate should deal with supporting
> Infinispan 7.2.1 in 4.3 earlier today. I think the consensus was it would
> be sufficient to:
> >> - specify the Infinispan 7.2 configuration by using
> hibernate.cache.infinispan.cfg (so Hibernate wouldn't have to switch if
> parsing failed);
> >> - run tests manually with Infinispan 7.2 for WildFly integration testing.
> >>
> >> I created another pull request:
> https://github.com/hibernate/hibernate-orm/pull/953
> >>
> >> My pull request incorporated some of Galder's changes from
> https://github.com/hibernate/hibernate-orm/pull/951.
> >>
> >> The main differences:
> >> - Hibernate will consider the 7.2 configuration as test code
> >> - the 7.2 configuration can be specified using
> -Dhibernate.cache.infinispan.cfg=src/test/resources/infinispan-7-configs.xml
> >>
> >> Currently, the only way to run hibernate-infinispan tests is to change
> infinispanVersion from 6.0.0.Final to 7.2.1.Final. It would be nice to be
> able to specify infinispanVersion as a environment variable, defaulting to
> 6.0.0.Final to avoid having to manually update libraries.gradle.
> >>
> >> Another consideration is that manually updating libraries.gradle forces
> a re-build using Infinispan 7.2.1 as a dependency.
> >>
> >> Since WildFly will use a hiberanate-infinispan jar build against
> Infinispan 6.0.0.Final (won't it???), I think it would be best if we could
> run unit tests without rebuilding with Infinispan 7.2.1, but using it as a
> run time dependency. I haven't been able to figure out how to do that
> though.
> >>
> >> Anyone have an idea how to do that, even manually?
> >>
> >> Thoughts on all this?
> >>
> >> Thanks,
> >> Gail
>
[View Less]
9 years, 11 months
Fwd: Build failed in Jenkins: hibernate-orm-master-h2 #900
by Steve Ebersole
Is there a reason that this particular hibernate-infinispan test continues
to be the one that fails when the CI jobs fail? It's a transient failure;
the jobs succeed a few times, then fail.
---------- Forwarded message ----------
From: "Hibernate CI" <ci(a)hibernate.org>
Date: May 13, 2015 12:44 PM
Subject: Build failed in Jenkins: hibernate-orm-master-h2 #900
To: <steve(a)hibernate.org>
Cc:
See <http://ci.hibernate.org/job/hibernate-orm-master-h2/900/changes>
>
> …
[View More]Changes:
>
> [Steve Ebersole] HHH-9790 - Remove deprecated methods from Session and
> SessionFactory
>
> ------------------------------------------
> [...truncated 767 lines...]
> JAVA6_HOME setting not specified, some build features will be disabled
> JAVA6_HOME setting not specified, some build features will be disabled
> JAVA6_HOME setting not specified, some build features will be disabled
> :documentation:clean
> :hibernate-c3p0:clean UP-TO-DATE
> :hibernate-core:clean UP-TO-DATE
> :hibernate-ehcache:clean UP-TO-DATE
> :hibernate-enhance-maven-plugin:clean UP-TO-DATE
> :hibernate-entitymanager:clean UP-TO-DATE
> :hibernate-envers:clean UP-TO-DATE
> :hibernate-gradle-plugin:clean UP-TO-DATE
> :hibernate-hikaricp:clean UP-TO-DATE
> :hibernate-infinispan:clean UP-TO-DATE
> :hibernate-java8:clean UP-TO-DATE
> :hibernate-jpamodelgen:clean UP-TO-DATE
> :hibernate-osgi:clean UP-TO-DATE
> :hibernate-proxool:clean UP-TO-DATE
> :hibernate-spatial:clean UP-TO-DATE
> :hibernate-testing:clean UP-TO-DATE
> :release:clean
> :documentation:compileJava UP-TO-DATE
> :documentation:processResources UP-TO-DATE
> :documentation:classes UP-TO-DATE
> :documentation:compileTestJava UP-TO-DATE
> :documentation:processTestResources UP-TO-DATE
> :documentation:testClasses UP-TO-DATE
> :documentation:test UP-TO-DATE
> :hibernate-core:generateGrammarSource
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> [ant:null] ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
> :hibernate-core:xjc
> :hibernate-core:compileJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-core:processResources
> :hibernate-core:classes
> :hibernate-core:jar
> :hibernate-c3p0:compileJavaNote: <
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-c3p0/tar...>
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-c3p0:processResources
> :hibernate-c3p0:classes
> :hibernate-testing:compileJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-testing:processResources
> :hibernate-testing:classes
> :hibernate-testing:jar
> :hibernate-c3p0:compileTestJava
> :hibernate-c3p0:processTestResources
> :hibernate-c3p0:testClasses
> :hibernate-c3p0:test
> :hibernate-c3p0:checkstyleMain
> :hibernate-c3p0:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-c3p0/tar...
> >
> :hibernate-c3p0:findbugsTest
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-c3p0/tar...
> >
> :hibernate-c3p0:buildDashboard
> :hibernate-core:generateTestGrammarSource UP-TO-DATE
> :hibernate-core:compileTestJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :hibernate-core:processTestResources
> :hibernate-core:testClasses
> :hibernate-core:test
> :hibernate-core:checkstyleMain
> Checkstyle rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-core/tar...
> >
> :hibernate-core:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-core/tar...
> >
> :hibernate-core:findbugsTest
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-core/tar...
> >
> :hibernate-core:buildDashboard
> :hibernate-ehcache:compileJavaNote: <
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-ehcache/...>
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-ehcache:processResources
> :hibernate-ehcache:classes
> :hibernate-ehcache:compileTestJavaNote: Some input files use unchecked or
> unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :hibernate-ehcache:processTestResources
> :hibernate-ehcache:testClasses
> :hibernate-ehcache:test
> :hibernate-ehcache:checkstyleMain
> :hibernate-ehcache:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-ehcache/...
> >
> :hibernate-ehcache:findbugsTest
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-ehcache/...
> >
> :hibernate-ehcache:buildDashboard
> :hibernate-enhance-maven-plugin:compileJavaNote: <
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/tooling/hibernate-...>
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-enhance-maven-plugin:processPluginXml
> :hibernate-enhance-maven-plugin:processResources
> :hibernate-enhance-maven-plugin:classes
> :hibernate-enhance-maven-plugin:compileTestJava UP-TO-DATE
> :hibernate-enhance-maven-plugin:processTestResources UP-TO-DATE
> :hibernate-enhance-maven-plugin:testClasses UP-TO-DATE
> :hibernate-enhance-maven-plugin:test UP-TO-DATE
> :hibernate-enhance-maven-plugin:checkstyleMain
> Checkstyle rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/tooling/hibernate-...
> >
> :hibernate-enhance-maven-plugin:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/tooling/hibernate-...
> >
> :hibernate-enhance-maven-plugin:findbugsTest UP-TO-DATE
> :hibernate-enhance-maven-plugin:buildDashboard
> :hibernate-entitymanager:compileJavaNote: Some input files use or override
> a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-entitymanager:processResources
> :hibernate-entitymanager:classes
> :hibernate-jpamodelgen:jaxb
> :hibernate-jpamodelgen:xjc SKIPPED
> :hibernate-jpamodelgen:compileJava
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-jpamodelgen:processResources
> :hibernate-jpamodelgen:classes
> :hibernate-jpamodelgen:jar
> :hibernate-entitymanager:compileTestJavaNote: Some input files use or
> override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :hibernate-entitymanager:copyBundleResources
> :hibernate-entitymanager:processTestResources
> :hibernate-entitymanager:testClasses
> :hibernate-entitymanager:test
> :hibernate-entitymanager:checkstyleMain
> Checkstyle rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-entityma...
> >
> :hibernate-entitymanager:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-entityma...
> >
> :hibernate-entitymanager:findbugsTest
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-entityma...
> >
> :hibernate-entitymanager:buildDashboard
> :hibernate-entitymanager:jar
> :hibernate-entitymanager:testJar
> :hibernate-envers:compileJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-envers:processResources
> :hibernate-envers:classes
> :hibernate-envers:compileTestJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :hibernate-envers:processTestResources
> :hibernate-envers:testClasses
> :hibernate-envers:test
> :hibernate-envers:checkstyleMain
> Checkstyle rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-envers/t...
> >
> :hibernate-envers:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-envers/t...
> >
> :hibernate-envers:findbugsTest
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-envers/t...
> >
> :hibernate-envers:buildDashboard
> :hibernate-gradle-plugin:compileJava UP-TO-DATE
> :hibernate-gradle-plugin:compileGroovywarning: Implicitly compiled files
> were not subject to annotation processing.
> Use -proc:none to disable annotation processing or -implicit to specify
> a policy for implicit compilation.
> 1 warning
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-gradle-plugin:processResources
> :hibernate-gradle-plugin:classes
> :hibernate-gradle-plugin:compileTestJava UP-TO-DATE
> :hibernate-gradle-plugin:compileTestGroovy UP-TO-DATE
> :hibernate-gradle-plugin:processTestResources UP-TO-DATE
> :hibernate-gradle-plugin:testClasses UP-TO-DATE
> :hibernate-gradle-plugin:test UP-TO-DATE
> :hibernate-gradle-plugin:checkstyleMain UP-TO-DATE
> :hibernate-gradle-plugin:findbugsMain UP-TO-DATE
> :hibernate-gradle-plugin:findbugsTest UP-TO-DATE
> :hibernate-gradle-plugin:buildDashboard
> :hibernate-hikaricp:compileJava
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-hikaricp:processResources
> :hibernate-hikaricp:classes
> :hibernate-hikaricp:compileTestJava
> :hibernate-hikaricp:processTestResources
> :hibernate-hikaricp:testClasses
> :hibernate-hikaricp:test
> :hibernate-hikaricp:checkstyleMain
> Checkstyle rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-hikaricp...
> >
> :hibernate-hikaricp:findbugsMain
> FindBugs rule violations were found. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-hikaricp...
> >
> :hibernate-hikaricp:findbugsTest
> :hibernate-hikaricp:buildDashboard
> :hibernate-infinispan:compileJavaNote: Some input files use or override a
> deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: <
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-infinisp...>
> uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Starting AnimalSniffer checks using [java16-1.0.signature] against
> [sourceSets.main]
> :hibernate-infinispan:processResources
> :hibernate-infinispan:classes
> :hibernate-infinispan:compileTestJavaNote: Some input files use or
> override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> :hibernate-infinispan:processTestResources
> :hibernate-infinispan:testClasses
> :hibernate-infinispan:test
>
> org.hibernate.test.cache.infinispan.query.QueryRegionImplTestCase >
> testEvict FAILED
> java.lang.AssertionError
>
> 136 tests completed, 1 failed, 5 skipped
> :hibernate-infinispan:test FAILED
> :hibernate-infinispan:buildDashboard
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':hibernate-infinispan:test'.
> > There were failing tests. See the report at: file://<
> http://ci.hibernate.org/job/hibernate-orm-master-h2/ws/hibernate-infinisp...
> >
>
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or
> --debug option to get more log output.
>
> BUILD FAILED
>
> Total time: 38 mins 33.676 secs
> Build step 'Execute shell' marked build as failure
> [CHECKSTYLE] Skipping publisher since build result is FAILURE
> [FINDBUGS] Skipping publisher since build result is FAILURE
> [TASKS] Skipping publisher since build result is FAILURE
> Recording test results
> Publishing Javadoc
>
[View Less]
9 years, 11 months
JMS configuration for the Hibernate Search backend
by Sanne Grinovero
Hi all,
I'm having an interesting conversation on the forums:
- https://forum.hibernate.org/viewtopic.php?f=9&t=1039407
Pawel is mentioning the need to configure a PROVIDER_URL property to
get his slaves to know were to connect to.
I'm pretty sure others have successfully configured this in the past,
so I guess there might be multiple ways to set such a thing up but my
hands on experience with JMS is very limited.
Would someone know how if we need to support configuring this
PROVIDER_URL,…
[View More] or explain what the alternatives are?
Thanks,
Sanne
[View Less]
9 years, 11 months
How to build Hibernate ORM / master ?
by Sanne Grinovero
Hi,
I'm having some trouble to build a fresh checkout from master.
The first attempt produced:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'hibernate-core-parent'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.github.lburgazzoli:lb-karaf-features-gen:1.0.0.SNAPSHOT.
So I checked out this plugin:
https://github.com/lburgazzoli/lb-gradle-plugins , installed it
locally.
Now I get :
…
[View More]
FAILURE: Build failed with an exception.
* Where:
Build file '/home/sanne/workspaces/hibernate/hibernate-core-parent/hibernate-osgi/hibernate-osgi.gradle'
line: 109
* What went wrong:
A problem occurred evaluating project ':hibernate-osgi'.
> Could not find method features() for arguments [hibernate_osgi_8b1jmrdt2yykus6805h9qfv3i$_run_closure8_closure18@705dc1a6] on project ':hibernate-osgi'.
Do I need to apply some patches to that plugin?
thanks,
Sanne
[View Less]
9 years, 11 months
Hibernate OGM: Multi-Tenancy?
by Sanne Grinovero
As I'm upgrading the Hibernate OGM -> Hibernate Search integration,
the new Search SPI explicitly demands a tenant-id on work
construction.
I suspect more work will be needed for multi-tenancy (at least some
tests) so I've opened OGM-821.
Might not be too complex? I suspect query results already respect the
restrictions.
I don't think multi-tenancy should be a very high priority for OGM,
but if this could pave the road to multiple-storage (different kinds)
.. now that would be really interesting.
Sanne
9 years, 11 months