Re: [hibernate-dev] CachingWrapperFilter

2015-02-16 Thread Sanne Grinovero
Hi Marc,
in theory we apply all the same optimisations as the "Lucene edition",
including the "acceptDocs" Bits as described in LUCENE-1536.

These are the main differences of our implementation:
 - uses the SoftLimitMRUCache rather than a synchronized WeakHashMap
 - uses Soft rather than Weak references
 - we do prevent duplicate computation for the same segments in case
of race conditions to prevent unnecessary CPU usage

Overall I'd expect this to perform better than the Lucene vanilla
version; that's probably not something I could state as an universal
truth but it's reasonable for our kind of integration. For example,
making those keys "weak" rather than "soft" would keep all filter
instances in memory, without any kind of upper bound: yes that might
look like "faster" in a couple of small tests but it's probably not
what you want!

Am I wrong? Please let me know if you've been measuring this and got
to different conclusions.

The drawback of soft keys is of course that in case you need a full gc
for other reasons, your cache is cleared. If that's your problem, we
should discuss about more advanced cache tuning options.

Sanne


On 15 February 2015 at 20:05, Marc Schipperheyn
 wrote:
> Just wondering with Lucene 4 whether the Hibernate CachingWrapperFilter
> should leverage that instead of using its own caching implementation. Given
> the discussion in LUCENE-1536.
>
> I'm not superfamiliar with this part of the code, but it looks like the
> LUCENE-1536 allows optimization at a deeper level.
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Enum object bound to SQLQuery

2015-02-16 Thread Emmanuel Bernard
Do we do any other conversion in SQLQueries from the property type to the SQL 
type? I don’t think we do.

> On 13 Feb 2015, at 06:15, Gail Badner  wrote:
> 
> Should enum objects be converted to the appropriate type when bound to a 
> native query?
> 
> It looks like they are converted properly when bound using a Criteria or HQL 
> Query, but not for a SQLQuery.
> 
> Attached is a patch for EnumTypeTest that shows that it works for Criteria 
> and HQL queries, and fails for SQLQuery.
> 
> Is this a bug?
> 
> Thanks,
> Gail___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Re: [hibernate-dev] Enum object bound to SQLQuery

2015-02-16 Thread Steve Ebersole
Probably the difference is the idea of "auto determination" of a
parameter's "expected" Type.  In HQL/JPQL and Criteria queries I have a lot
of code in place to determine the expected type of a parameter based any
"corresponding property reference".  In native SQL queries there is no such
opportunity to perform this "auto determination".

On Mon, Feb 16, 2015 at 10:33 AM, Emmanuel Bernard 
wrote:

> Do we do any other conversion in SQLQueries from the property type to the
> SQL type? I don’t think we do.
>
> > On 13 Feb 2015, at 06:15, Gail Badner  wrote:
> >
> > Should enum objects be converted to the appropriate type when bound to a
> native query?
> >
> > It looks like they are converted properly when bound using a Criteria or
> HQL Query, but not for a SQLQuery.
> >
> > Attached is a patch for EnumTypeTest that shows that it works for
> Criteria and HQL queries, and fails for SQLQuery.
> >
> > Is this a bug?
> >
> > Thanks,
> > Gail___
> > hibernate-dev mailing list
> > hibernate-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
>
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Re: [hibernate-dev] Enum object bound to SQLQuery

2015-02-16 Thread Gail Badner
OK, so this is expected.
Thanks!
Gail

- Original Message -
> From: "Steve Ebersole" 
> To: "Emmanuel Bernard" 
> Cc: "Gail Badner" , "Hibernate Dev" 
> 
> Sent: Monday, February 16, 2015 11:55:54 AM
> Subject: Re: [hibernate-dev] Enum object bound to SQLQuery
> 
> Probably the difference is the idea of "auto determination" of a
> parameter's "expected" Type.  In HQL/JPQL and Criteria queries I have a lot
> of code in place to determine the expected type of a parameter based any
> "corresponding property reference".  In native SQL queries there is no such
> opportunity to perform this "auto determination".
> 
> On Mon, Feb 16, 2015 at 10:33 AM, Emmanuel Bernard 
> wrote:
> 
> > Do we do any other conversion in SQLQueries from the property type to the
> > SQL type? I don’t think we do.
> >
> > > On 13 Feb 2015, at 06:15, Gail Badner  wrote:
> > >
> > > Should enum objects be converted to the appropriate type when bound to a
> > native query?
> > >
> > > It looks like they are converted properly when bound using a Criteria or
> > HQL Query, but not for a SQLQuery.
> > >
> > > Attached is a patch for EnumTypeTest that shows that it works for
> > Criteria and HQL queries, and fails for SQLQuery.
> > >
> > > Is this a bug?
> > >
> > > Thanks,
> > > Gail___
> > > hibernate-dev mailing list
> > > hibernate-dev@lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> >
> > ___
> > hibernate-dev mailing list
> > hibernate-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> 

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev