StatelessSession query uniquing is inconsistent

Description

StatelessSession uniquing is inconsistent as in sometimes a query will use its temporary persistencecontext (introduced for HHH-1266) to return unique entity instances and in others it wont.

According to the initial semantics intended (see HHH-742) it should actually do it for each query.

Main issue is that:

getEntityUsingInterceptor does not check temp persistencecontext
internalLoad does not check temp persistencecontext nor create proxies consistent with get()

Attachments

2

Activity

Show:

Max Rydahl Andersen April 15, 2007 at 7:35 PM

src and test patch for suggested fix.

note that the test also contains a commented out test for relevant stateless-Interceptor support.

Max Rydahl Andersen April 15, 2007 at 2:09 PM

assume db with 1doc and 2 chapters
"select d from Document d left join d.chapters c"

returns two different Document instances

"select d from Document d left join fetch d.chapters c"

returns two different Document instances, their chapters point to the same instances, but chapter.getDocument() point to two completelty different proxies

"ss.createQuery( "select d from Document d left join fetch d.chapters c left join fetch c.document"

returns two different Document instances, their chapters point to the same instances, and chapter.getDocument() point to two completelty different proxies which in turn point to the same Document root.

Details

Assignee

Reporter

Components

Priority

Created April 15, 2007 at 2:04 PM
Updated April 15, 2007 at 7:35 PM