-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate second-level cache in orm.xml
PostPosted: Thu May 28, 2009 6:04 am 
Newbie

Joined: Wed May 20, 2009 12:06 pm
Posts: 2
Hello,

Having been googling for hours, I realize that users can use either xml file(orm.xml, I suppose?) or annotations in JPA, or both of them at the same time. I'm i correct?
So, My project use the second-level cache, which is not in the JPA specification. And I use annotations like:
@org.hibernate.annotations.Cache(usage =
org.hibernate.annotations.CacheConcurrencyStrategy.READ_WRITE
)
for each entities.
However, I guess that the annotation above doesn't belongs to be JPA annotation, therefore, I don't know if there is anything equivalent in orm.xml? I have had a look at the xml schema of orm.xml, and there is not such hibernate element permitted in the schema.

If I can't do the second-level cache config in the orm.xml, is there any way other than in the annotation? The reason that I don't want to do it the annotation is because I have two applications, one use READ_WRITE concurrency strategy and another use READ_ONLY concurrency strategy.

Thanks in advance!!!

Kewei


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.