REPEATABLE_READ in JBC as Hibernate 2nd Level Cache
by Brian Stansberry
Can anyone see a reason to use REPEATABLE_READ as the JBoss Cache
isolation level in the 2nd level cache use case? I'm not seeing one, and
it certainly hurts performance by forcing cache writes to block waiting
for an earlier tx that did a read to commit.
There are 4 types of data cached:
1) Entities
If an entity is read from the 2LC, for the life of the tx it will be
cached in the Session, so AIUI there should be no second read during the
tx. So no benefit to RR.
2) Collections
Same as entities.
3) Queries
If an application executes a query twice in the same tx, I wouldn't
think they'd expect the same result. In any case, if an update to the
query cache is blocking waiting for a tx that previously read the query
result to release, the existence of the update that means the
underlying entities and their timestamps have changed. So a repeated
read of the cached query will just result in it being discarded as out
of date anyway.
4) Timestamps
Here you don't want an RR semantic. You always want to get the most
up-to-date data.
Anyone see any holes in my thinking?
--
Brian Stansberry
Lead, JBoss AS Clustering
JBoss, a division of Red Hat
16 years, 5 months
Abstraction from Hibernate Core
by Emmanuel Bernard
I've (re-)fixed the conflict of patches we had between Navin's commit
and my original proposed fixes. I've also fixed a but between
annotations head and search head wrt event listener initializations
(that's why I don't like ivy not pointing to latest :) )
Please please please everyone:
- use the right style template. I have one for IntelliJ I can
provide, I'm sure someone has one for Eclipse. No more style conflict
madness.
- run ant clean junit before committing. If it fails, do not commit.
BTW We are close to the beta 1 freeze, likely to be tonight or tomorrow
A few questions and comments
@ProvidedId
Should @ProvidedId be renamed @ExternalId?
ProvidedId.bridge() is no longer of type Class<StringBridge>, just
Class (see later)
name() defaults to providedId (I still think "id" is a better name,
though)
SearchFactoryImpl
I've done various refactorings to eliminate the dependency between
o.h.c.Configuration and SearchFactoryImpl
The event system is now responsible for converting the
o.h.c.Configuration into a Search configuration
TransactionContext
I moved them next to the Worker and Worker queues in backend (its
implementation is in backend.impl
renamed isTxInProgress() to a readable name
I removed TransactionContext as Serializable, each implementation
shold make its own decision. EventsourceTC is not serialzible: they
could use transient / readObject / writeObject
SearchConfiguration
The HibernameImplementation now deal with getMappedClass() returning
null. I used Class<?> instead of the raw Class in the interface.
Here are the things Navin still needs to work on:
DocumentBuilder
1. @ProvidedId can be set on a superclass, your code does not deal
with it
2. you've hardcoded the bridge implementation to StringBridge, this is
not good and should be configured by ProvidedId.bridge().This should
be done more or less like BridgeFactory.extractType(ClassBridge);
Those 2 need to be fixed before we go and release the @ProvidedId
feature but this can wait till after Beta1
--
Emmanuel Bernard
http://in.relation.to/Bloggers/Emmanuel | http://blog.emmanuelbernard.com
| http://twitter.com/emmanuelbernard
Hibernate Search in Action (http://is.gd/Dl1)
16 years, 5 months
Case...When..then... problem
by ManiKanta G
Hi,
I've a query in MySQL which includes CASE.... WHEN... THEN...THEN....END
type, which i working fine.
select cds.id,
case when cds.source_type = 'c'
then (select cm.company_name from esi_companymaster cm where
cm.company_code = cds.source_id)
when cds.source_type = 'd'
then (select dm.dealer_name from esi_dealermaster dm where
dm.dealer_code = cds.source_id) end
as company_dealer_name
from esi_cds_issues_dispensary_details cds
But when I converted the same into HQL, like the below one:
select cds.id,
case when cds.sourceType is 'c'
then (select cm.companyName from CompanyMaster cm where cm.companyCode =
cds.sourceId)
when cds.sourceType is 'd'
then (select dm.dealerName from DealerMaster dm where dm.dealerCode =
cds.sourceId) end
as company_dealer_name
from IssuestoDispenceryDetails cds
I m getting NullPointerException (unexpected AST node: query) exception.
Can any one suggest me what am I doing wrong? or is there any work
around for this.
I need this very urgent. Thanks in advance.
Regards,
ManiKanta G
********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin(a)sifycorp.com
16 years, 5 months
Forcing an optimize call after a purgeAll
by John Griffin
I would not force it, but I would allow it to happen probably by a config
option. As you know optimize causes a rewrite of the Lucene document numbers
and the user may not want to do that until THEY decide to do it. My 2 cents.
John G.
-----Original Message-----
From: hibernate-dev-bounces(a)lists.jboss.org
[mailto:hibernate-dev-bounces@lists.jboss.org] On Behalf Of
hibernate-dev-request(a)lists.jboss.org
Sent: Sunday, July 13, 2008 10:00 AM
To: hibernate-dev(a)lists.jboss.org
Subject: hibernate-dev Digest, Vol 25, Issue 13
Send hibernate-dev mailing list submissions to
hibernate-dev(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/hibernate-dev
or, via email, send a message with subject or body 'help' to
hibernate-dev-request(a)lists.jboss.org
You can reach the person managing the list at
hibernate-dev-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of hibernate-dev digest..."
Today's Topics:
1. fullTextSession.purgeAll() (Emmanuel Bernard)
2. Hibernate join problem (sylvain mouquet)
----------------------------------------------------------------------
Message: 1
Date: Sat, 12 Jul 2008 15:57:18 -0400
From: Emmanuel Bernard <emmanuel(a)hibernate.org>
Subject: [hibernate-dev] fullTextSession.purgeAll()
To: hibernate-dev(a)lists.jboss.org
Message-ID: <095C2590-2D16-453D-BF7A-6813612D88A6(a)hibernate.org>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Should we force an optimize call after a purgeAll operation? This
sounds sensible as it will reclaim unused space. OTOH it will likely
break opened readers.
--
Emmanuel Bernard
http://in.relation.to/Bloggers/Emmanuel | http://blog.emmanuelbernard.com
| http://twitter.com/emmanuelbernard
Hibernate Search in Action (http://is.gd/Dl1)
------------------------------
Message: 2
Date: Sun, 13 Jul 2008 12:20:36 +0200
From: "sylvain mouquet" <flashman22(a)gmail.com>
Subject: [hibernate-dev] Hibernate join problem
To: hibernate-dev(a)lists.jboss.org
Message-ID:
<6c528ebf0807130320n4a8bf728me1a0b7ffd9a3fe92(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi
I have not understand why you tell that you have 3 tables. HQL is based on
core model (mapping files) not on SQL tables.
You must write the query in hql and you must use objects in your core model
not id :
select dm.id, dm.drug_name, sum(cds.qty_available)
from drug_master dm
left join cds_drugstore.drug_master cds
and cds.cds_id = 1
and cds.source_id = 'sourceName'
and cds.source_type = 'c'
group by dm.id
16 years, 5 months
Hibernate join problem
by sylvain mouquet
Hi
I have not understand why you tell that you have 3 tables. HQL is based on
core model (mapping files) not on SQL tables.
You must write the query in hql and you must use objects in your core model
not id :
select dm.id, dm.drug_name, sum(cds.qty_available)
from drug_master dm
left join cds_drugstore.drug_master cds
and cds.cds_id = 1
and cds.source_id = 'sourceName'
and cds.source_type = 'c'
group by dm.id
16 years, 5 months