Re: [hibernate-dev] [OGM] EntityKey missing methods ?
by Emmanuel Bernard
Because Hibernate raises an exception if you call persist on an already existing entry.
On 3 mars 2012, at 11:54, Guillaume SCHEIBEL wrote:
> Ok greate, so why the engine calls getTuple when I perform a persist if it's to check that the object to persist is already existing ?
>
> Guillaume
>
> 2012/3/3 Emmanuel Bernard <emmanuel(a)hibernate.org>
> OGM-40 will add those, it's next on my todo list. But you should not have do read the DB to know if an object is already there. That's the job of the hibernate engine and it is reflected in the dialect API. If you are missing something, let me know.
>
> On 3 mars 2012, at 11:32, Guillaume SCHEIBEL <guillaume.scheibel(a)gmail.com> wrote:
>
> > Hello,
> >
> > For example, you you try to persist an object the method "public Tuple
> > getTuple(EntityKey key)" is called but you cannot try to look into the
> > database to check whether the persisted object already exists or not
> > because the EntityKey class doesn't provide any getter method about the
> > table or the id.
> >
> > Is there a different way (that I didn't see) to do that or create the
> > getters is the good (and the simplest) solution ?
> >
> > Guillaume
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
12 years, 10 months
[OGM] Configurations files and naming
by Guillaume SCHEIBEL
Hi guys,
About specific configurations, I'm wondering which strategy is the best:
- Putting all configuration into the general configuration files
(like persistence.xml or hibernate.properties)
- Having a specific for each ogm implementation (ispn-config.xml,
mongodb-config.xml)
And is there any naming convention for properties
(hibernate.mongodb.database for example) ?
Guillaume
12 years, 10 months
[OGM] EntityKey missing methods ?
by Guillaume SCHEIBEL
Hello,
For example, you you try to persist an object the method "public Tuple
getTuple(EntityKey key)" is called but you cannot try to look into the
database to check whether the persisted object already exists or not
because the EntityKey class doesn't provide any getter method about the
table or the id.
Is there a different way (that I didn't see) to do that or create the
getters is the good (and the simplest) solution ?
Guillaume
12 years, 10 months
Natural ids and inheritance
by Steve Ebersole
Another discrepancy between hbm.xml and annotations currently is the
definition of natural ids. hbm.xml only allows natural ids to be
defined on the root entity, annotations allow it to be defined on any
level of the hierarchy, even across classes.
We need to decide what we want to support. 2 things to consider here are:
1) whether we limit @NaturalId to only root entity meta (and maybe
@MappedSuperclass for root entities)
2) if we do not limit, what @NaturalId spread across a hierarchy "means"
In the second point, consider:
class A
@NaturalId
key1
class AA extends A
@NaturalId
key2
Personally I vote for limiting @NaturalId to the root entity. This
allows caching to work just like it does for identifiers.
--
steve(a)hibernate.org
http://hibernate.org
12 years, 10 months
HSEARCH-598 (was: Beginner's tasks for Hibernate Search and Hibernate OGM)
by Sanne Grinovero
Hi Guillaume,
I'm aware of the issue, and I wouldn't mind some help on it: it would
be better to fix the MassIndexer design to use a limited set of
threads than to expose more metadata information, don't you agree?
The reason for me to not have given a high priority to HSEARCH-598 are
1) there are easy workarounds
2) I have no tests
Writing an automated test is in this case I think 90% of the
complexity; if you would like to do that, I think I could fix it
quickly or at least propose many possible solutions.
Ideally for this to be included in 4.1.0.Final we should finish it
next week.. do you think you could help with it?
Sanne
On 1 March 2012 10:22, Guillaume Smet <guillaume.smet(a)gmail.com> wrote:
> Hi Emmanuel,
>
> Here is what I have in mind:
> - Providing a nice API to get the indexed classes. Currently I use
> something extracted from MassIndexerImpl#toRootEntities. We use it
> currently for our reindexAll implementation. As the MassIndexer uses
> too much threads and connections when you have a lot of entities, it
> allows us to limit this number by working an entity at a time. This
> one should be easy: the code is already written but it needs
> refactoring and a proper API.
>
> - https://hibernate.onjira.com/browse/HSEARCH-598 : this is the main
> issue why we need the above workaround. I'm pretty sure it could be
> possible to set a global maximum number of threads instead of a limit
> per entity which is a problem when you have a lot of indexed entities.
> Just to explain the problem, we have customers which don't authorize
> more than 20 connections to the database cluster for applications with
> only a few users. It's currently difficult to use the MassIndexer out
> of the box in this particular use case. I don't know the MassIndexer
> code well enough to know if it's an easy task or not but it might be.
>
> BTW, on the same subject, it might be a good idea to work together at
> Mix-IT in Lyon - I saw you've planned to speak here.
>
> --
> Guillaume
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
12 years, 10 months
Beginner's tasks for Hibernate Search and Hibernate OGM
by Emmanuel Bernard
I will be doing a Hackergarten session next week with Hibernate Search and OGM as projects. A hackergarten is one project master and a few wannabe contributors hacking for a night on a few issues. I am looking for beginner materials for Hibernate OGM or Search. If you have ideas, let me know.
Emmanuel
12 years, 10 months
Pull requests for JIRA issues related to NaturalIdLoadAccess
by Gail Badner
I noticed that Eric Dalquist created some pull requests for JIRA issues related to NaturalIdLoadAccess. These issues are not scheduled for fixing yet.
Should they be scheduled for 4.1.1? Is there someone that plans to apply them? Should I do it?
Please let me know.
Thanks,
Gail
12 years, 10 months
infinispan test fails occasionally on hudson
by Strong Liu
could someone take a look?
org.hibernate.test.cache.infinispan.functional.ConcurrentWriteTest.testManyUsers
Error Message
java.util.concurrent.TimeoutException
Stacktrace
java.util.concurrent.TimeoutException
at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:222)
at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:399)
at org.hibernate.test.cache.infinispan.functional.ConcurrentWriteTest.testManyUsers(ConcurrentWriteTest.java:223)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.hibernate.testing.junit4.FailureExpectedHandler.evaluate(FailureExpectedHandler.java:59)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.hibernate.testing.junit4.BeforeClassCallbackHandler.evaluate(BeforeClassCallbackHandler.java:43)
at org.hibernate.testing.junit4.AfterClassCallbackHandler.evaluate(AfterClassCallbackHandler.java:42)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:51)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:63)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
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:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:75)
at $Proxy3.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:91)
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:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.TypeCastDispatch.dispatch(TypeCastDispatch.java:30)
at org.gradle.messaging.remote.internal.WorkerProtocol.handleIncoming(WorkerProtocol.java:53)
at org.gradle.messaging.remote.internal.WorkerProtocol.handleIncoming(WorkerProtocol.java:31)
at org.gradle.messaging.remote.internal.ProtocolStack$ProtocolStage.handleIncoming(ProtocolStack.java:167)
at org.gradle.messaging.remote.internal.ProtocolStack$BottomStage.handleIncoming(ProtocolStack.java:277)
at org.gradle.messaging.remote.internal.ProtocolStack$BottomConnection$1.run(ProtocolStack.java:299)
at org.gradle.messaging.remote.internal.ProtocolStack$ExecuteRunnable.dispatch(ProtocolStack.java:120)
at org.gradle.messaging.remote.internal.ProtocolStack$ExecuteRunnable.dispatch(ProtocolStack.java:116)
at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)
at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
-------------------------
Best Regards,
Strong Liu <stliu at hibernate.org>
http://about.me/stliu/bio
12 years, 10 months