Re: [hibernate-dev] Closed: (HHH-7160) Method NaturalIdXrefDelegate#cache() misses to remove obsolete entry in naturalIdToPkMap when NaturalId values changed
by Demetz, Guenther
Hi Steve,
in HHH-7160 we forgot to consider the 2nd-Level-Cache when removing the key from naturalIdToPkMap:
private static class NaturalIdResolutionCache implements Serializable {
...
final CachedNaturalId initial = pkToNaturalIdMap.get( pk );
if ( initial != null ) {
if ( areSame( naturalIdValues, initial.getValues() ) ) {
return false;
}
naturalIdToPkMap.remove( initial ); // OK for first level-cache,
// but if persister.hasNaturalIdCache() then CachedNaturalId must also be evicted from second level cache too
The dilemma:
non-static method evictNaturalIdResolution cannot be called here ( we are in a static context)
I have already test-case which demonstrates the bug:
session.bySimpleNaturalId(...).load(obsolete_key) resolves and returns object from 2nd-LevelCache
How should I proceed? Should I open another issue for this?
best regards
Guenther
-----Original Message-----
From: Steve Ebersole (JIRA) [mailto:noreply@atlassian.com]
Sent: Thursday, March 15, 2012 12:02 AM
To: Demetz, Guenther
Subject: [Hibernate-JIRA] Closed: (HHH-7160) Method NaturalIdXrefDelegate#cache() misses to remove obsolete entry in naturalIdToPkMap when NaturalId values changed
[ https://hibernate.onjira.com/browse/HHH-7160?page=com.atlassian.jira.plug... ]
Steve Ebersole closed HHH-7160.
-------------------------------
Resolution: Out of Date
This was already addressed as part of another issue
> Method NaturalIdXrefDelegate#cache() misses to remove obsolete entry
> in naturalIdToPkMap when NaturalId values changed
> ----------------------------------------------------------------------
> ------------------------------------------------
>
> Key: HHH-7160
> URL: https://hibernate.onjira.com/browse/HHH-7160
> Project: Hibernate ORM
> Issue Type: Bug
> Components: core
> Affects Versions: 4.1.1
> Environment: Hibernate4.1.1
> Reporter: Guenther Demetz
> Labels: naturalId
> Attachments: TestCaseNaturalIdChangeBetweenPersistAndFlush.jar
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Method NaturalIdXrefDelegate#cache() misses to remove obsolete entry
> in naturalIdToPkMap when NaturalId values changed, thus NaturalIdAccess delivers results even by searching with obsolete values (see attached Testcase).
> Cause:
> following instruction is missing in Method NaturalIdXrefDelegate#cache():
> if ( initial != null ) {
> if ( areSame( naturalIdValues, initial.getValues()) ) {
> return false;
> }
> naturalIdToPkMap.remove(initial); // <-- this instruciton is missing
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
OGM - BasicGridBinder log issue
by Guillaume SCHEIBEL
Hello,
I have noticed that the BasicGridBinder has a problem when it logs the
bindding ( BasicGridBinder.bind(Tuple, X, String[] ) method).
Actually, the trace is "binding [$s] to parameter(s) $s" but it should be
"binding [thevalue] to parameter(s) theparameter".
It can be fixed easily by modifying the two calls to log.tracef() (line 70
and 76) respectively like that:
log.tracef( "binding [null] to parameter [%1$s]", name );
and
log.tracef( "binding [%1$s] to parameter(s) %2$s",
javaDescriptor.extractLoggableRepresentation( value ), Arrays.toString(
names ) );
Should a new Jira be opened or I can inclued it into OGM-123 (mongodb
implementation) ?
Cheers,
Guillaume
12 years, 9 months
Covariant returns
by Steve Ebersole
Can someone verify I am not off my rocker here? Re :
https://hibernate.onjira.com/browse/HHH-7161
We have a case where Session defines a method that returns a public
interface org.hibernate.IdentifierLoadAccess. When SessionImpl
implements those methods it redefines the return to instead be a private
inner class that implements that org.hibernate.IdentifierLoadAccess
interface.
As I understood it, when accessed through the Session interface what
return type is defined by SessionImpl is irrelevant. And indeed I am
not able to reproduce this when access those methods via Session. My
IDE gives me errors if I try to cast that reference to SessionImpl
instead.
--
steve(a)hibernate.org
http://hibernate.org
12 years, 9 months
@Entity and inheritance with annotations
by Steve Ebersole
Can someone help me understand whether this is valid annotation mapping:
@Entity
class A {
}
@Entity
class B extends A {
}
?
My understanding was that an @Entity extending an @Entity had to specify
an inheritance strategy? And that this example is really the point of
@MappedSuperclass:
@MappedSuperclass
class A {
}
@Entity
class B extends A {
}
--
steve(a)hibernate.org
http://hibernate.org
12 years, 9 months
Releasing another CR for Search?
by Sanne Grinovero
There was a plan to release Hibernate Search 4.1.0.Final today, but
we've been thinking to slip it as it's currently unclear if we should
upgrade to Hibernate ORM 4.1.x or stay with the current 4.0.x, as
that's what the current version of AS 7.1.1.Final is using: there is a
change in ORM which makes it hard for Search to support both 4.1.x and
4.0.x.
So the Final won't happen today. Shall we release another CR ? I think
we need a release, and there are still quite some changes in it so a
CR would be healthy.
Sanne
12 years, 9 months
OGM-123 Support MongoDB as datastore - Unit tests
by Guillaume SCHEIBEL
Hello,
About unit tests during the development phase on OGM-mongodb, I'm wondering
what is the best way.
Actually, I've developped some specific tests (CRUD mainly) because I was
not aware of the existing test suite. So my question is: should I remove
all my tests and just use core test or should I let them to test specific
points (like @Embdedded into @Embedded) ?
And am I wrong if I say that to launch the core test suite I just have to
add a simple hibernate.properties into src/test/resources/ of the mongodb
module and launch maven with the test goal ?
Thanks
Guillaume
12 years, 9 months
Bean Validation 1.1 early draft 1 is out
by Emmanuel Bernard
Hi all,
I have pushed the early draft we have been discussion for a while now to the JCP. I also put a copy in the open. Check out http://goo.gl/FlAuQ
It contains main TODOs I would like your opinion on. But that's a significant work that moves dependency injection and method-levle validation forward. We will be able to focus on the next items in our roadmap.
Emmanuel
12 years, 9 months
zanata
by Strong Liu
Hi there
I had a chat with James last week about using zanata for hibernate translation ( James and Sean are cc'd, they are both zanata developers, in case I got something wrong).
zanata server has a "merge" function, with each local change, we need manually upload pot and po again to get it merged with the po in zanata server.
we'd need to do this before release process start (before tag)
it would be great if zanata server could monitor git repo and merge changes automatically
-------------------------
Best Regards,
Strong Liu <stliu at hibernate.org>
http://about.me/stliu/bio
12 years, 9 months