[OGM] MongoDB time spikes
by Emmanuel Bernard
Hi Alan and all,
I have been researching the spikes issue you encounter in the stress test from a theoretical point of view.
You were trying a different associations storage approach (splitting associations as one row per document rather than the whole association per document). Does that return better results?
I am skeptical for a few reasons. MongoDB has a global write lock per mongod process (they are working on a more fine grained solution). So if the spikes are due to lock contention, shuffling data won't help much. Also make sure you use MongoDB 2.0 instead of 1.8 as they yield lock on page fault which should solve a lot of these spikes problems.
I have found this blog entry to be quite insightful http://blog.pythonisito.com/2011/12/mongodbs-write-lock.html
Generally speaking, if all data can stay in memory, MongoDB should behave wonderfully.
Which leads to my demo and the time difference between Infinispan 5s and Mongodb 20s. I can see several reasons:
- we don't really batch operations in the mongodb dialect and we should.
We should accumulate operations and apply them at the end of the flush operation in one batch. That will require some new infrastructure from OGM's engine though
to tell the dialect when to "flush".
- my VM might swap memory on disk which would explain the difference
- or it could be that Infinispan is simply 4 times faster which would not be too surprising as Infinispan is in-process.
Emmanuel
12 years, 7 months
Re: [hibernate-dev] HSearch compile issue
by Sanne Grinovero
Hi Gail,
thanks! no this wasn't having a jira yet, just related to a failing
build on one of the Jenkins builds.
Created right now as HSEARCH-1106, all yours.
It's also related to the thread by Nicolas, apparently unable to build
Search for the same reason: see the ML thread "HSEARCH-1084 build
failed"
Cheers,
Sanne
On 24 April 2012 21:28, Gail Badner <gbadner(a)redhat.com> wrote:
> I'm ready to create a pull request that gets rid of the compile errors when building with:
>
> Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
> Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
>
> Sanne, I thought you mentioned there was a jira issue created for this already. I'm having trouble finding it.
>
> Please let me know which issue...
>
> Thanks,
> Gail
12 years, 7 months
[OGM] MongoDB dialect and treatment of _id
by Emmanuel Bernard
I would like to discuss the problem of _id in MongoDB and how to map that in Hibernate OGM.
MongoDB is a bit psycho-rigid in how it uniquely identifies a document. A special property named _id is used for that and must be unique across a collection. It is also strongly recommended to let MongoDB generate this id (a UUID essentially).
In the MongoDb dialect we have not settled on how to use _id. and I would like to clarify that. Today we use `dbObject.put(ID_FIELDNAME, key.getColumnValues()[0])` but that is only correct if the id property is mapped to a single column. (ie `key.getColumnNames().length == 1`)
## Use _id as a OracleDB rowid
We could decide to use _id as a purely internal identifier for a document and basically never ever rely on it. All queries and lookup with use the identifier columns and their value to find a document.
That has the benefit of not having to deal with _id but I don't know if that's an OK practice in MongoDB or if it's not recommended at all as it would lead to costly lookups. Anybody familiar with MongoDB can shime in?
## Map _id when we have a identifier mapped on one column
In this case, I will only discuss the case where an id is mapped to a single column.
We could decide to map the id column value to both the id column and to _id. That creates some duplication but OGM would be happy and MongoDB's queries could be efficient.
Alternatively, we could decide to completely ignore the id column name and use _id for this. The TupleShapshot would then be responsible for binding the id column name to the value stored in _id. My concern with the alternative is that someone reading the data from the mongodb store will not find the JPA id column but rather see _id. On the other hand it seems to be the norm in the MongoDB land.
### Identifiers mapped on several columns
In this case, we have three approaches that can be combined:
1. treat _id as rowid (see avove)
2. map id values as a complex object and put that in _id eg { "_id": { "firstname": "Emmanuel", "lastname": "Bernard"} }
Note that we can then decide to bind the id columns as top level attributes of the document as well.
Do you guys have any thoughts on the best approach?
12 years, 7 months
Re: [hibernate-dev] [HV] Running single TCK tests
by Gunnar Morling
Am 24.04.2012 10:32 schrieb "Hardy Ferentschik" <hardy(a)hibernate.org>:
>
>
> On Apr 23, 2012, at 10:38 PM, Gunnar Morling wrote:
>
> > I was wondering whether there is any best practice for running single
> > tests from the BV TCK.
>
> Not sure about best practice, but one way is via the TestNG suite file
which
> gets extracted into the target/dependency directory of the tcp-runner
module.
> You can edit as you like using <packages> and <classes> nodes.
>
Ah, that's a good idea, I'll try that.
> This is also the best way for running the TCK in the IDE. I added a new
section on
> the Validator wiki explaining how to setup things in Idea:
>
>
https://community.jboss.org/wiki/ContributingToHibernateValidator#Running...
Thanks. I can add something on Eclipse if it's working.
>
> I would expect Eclipse to work similar.
>
> --Hardy
--Gunnar
_______________________________________________
> hibernate-dev mailing list
> hibernate-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
12 years, 7 months
HHH-7237
by Demetz, Guenther
Hi Steve,
thank you for fixing HHH-7237 (Inline natural-id synchronization doesn't consider reattached objects).
Unfortunately only now, with a fresh checkout, I saw that the fix makes org.hibernate.test.naturalid.immutable.ImmutableEntityNaturalIdTest.testNaturalIdCheck fail.
Sorry for that.
A solution which turns all involved test-cases to green,
could be to add following condition in method AbstractEntityPersister#afterReassociate
<< if ( hasNaturalIdentifier()) {
>> if ( hasNaturalIdentifier() && !getEntityMetamodel().hasImmutableNaturalId() ) { // relevant only for mutable NaturalId's
best regards
Günther
12 years, 7 months
[HV] Running single TCK tests
by Gunnar Morling
Hi,
I was wondering whether there is any best practice for running single
tests from the BV TCK.
My use case is that I've changed something in HV and now a test of the
hibernate-validator-tck-runner module fails. I'd like to be able to
run/debug the specific failing test, but I'm not aware of any simple
way to do this. So what I've been doing in such cases so far is to
copy the concerned test from the TCK Jar into the actual runner module
where I can execute it then. While this works, I'm wondering whether
there is an easier way to do this.
Thanks,
--Gunnar
12 years, 7 months
Idea setup problems
by Hardy Ferentschik
Hi,
has anyone recently tried './gradlew idea'?
I am trying to recreate my idea setup and after creating the project files and opening the project I am having problems compiling in the IDE. It keeps whining about ExtendedFrameworkMethod (testing module) not implementing a method of the super type. I noticed that the junit version got upgraded to 4.10. Funny enough I am still having
4.8.2 and 4.10 in the list of project dependencies (according to Idea). Downgrading to 4.8.2 in build.gradle and recreating the project files worked (and I only get one
junit dep in the IDE). Before you ask - I did try cleanIdea and the build works fine with 4.10 from the command line.
As a side node, I updated https://community.jboss.org/wiki/BuildingHibernateORM4x with some information running single tests or skipping tests altogether. Our matrix setup forces us to be a little more specific.
--Hardy
12 years, 7 months
Associations on cassandra
by Emmanuel Bernard
Here are my notes on Cassandra association. Note very readable but at least that there.
## Associations
Associations on composite keys cannot be supported in CQL 2. It can be done in CQL3
How to store associations will depend upon their type:
### Set
table:fk_column { fk_to -> ""}
### Bag
table:fk_column { fk_to -> n } where n is the number of occurrences
### List / Map (simple key)
table:fk_column { indexOrKey -> fk_to } where n is the number of occurrences
12 years, 7 months
Meeting
by Steve Ebersole
I wont be able to make the meeting today. Something came up with kids and
school.
I'd say go ahead with the meeting if yall have stuff to discuss.
steve(a)hibernate.org
http://hibernate.org
12 years, 7 months
metamodel branch and identifier handling
by Steve Ebersole
The main pieces of identifier handling are in place now on the metamodel
branch. Probably still needs some work in terms of building persisters,
etc but what doesn't on that branch ;)
Anyway, one thing in particular I was hoping to get a discussion on is
the org.hibernate.metamodel.spi.binding.EntityIdentifier class. The
javadocs kind of tell the story, but basically it represents a dual
contract (single versus multiple attribute identifiers).
If anyone has time to take a look and give feedback that would be great!
--
steve(a)hibernate.org
http://hibernate.org
12 years, 7 months