-->
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: JPA, JBoss 4.2.3, and JBossCache - problems
PostPosted: Thu Sep 30, 2010 3:11 am 
Newbie

Joined: Thu Jan 05, 2006 3:59 pm
Posts: 10
So, I have a JPA project, running on JBoss 4.2.3, and I just recently wired up JBossCache as the 2nd level cache for it.

Everything ran smoothly, 'til I tried to optimize a bit.

Then I hit issues. I have a 'Campaign' object with a 'Nodes' collection and a 'Connectors' each mapped as a one-to-many relationship. Works fine, even with caching. I have each collection set up in its own cache region.

Then I put the @BatchSize annotation on the collections and all hell breaks loose. Suddenly I start getting errors like this:

org.hibernate.cache.CacheException: org.jboss.cache.lock.TimeoutException failure acquiring lock: fqn=/, caller=Thread[ajp-###.###.###.###-
####-7,5,jboss], lock=read owners=[GlobalTransaction:<###.###.###.###:####>:18] (org.jboss.cache.lock.LockStrategySerializable@6c9d476e)

What it looks like to me is that each collection when it went to batch, tried to lock the appropriate cache region, and failed, puking since I have 'Serializable' isolation set. So why the 'fqn=/' if my cache region is 'campaign/nodes' for one collection and 'campaign/connectors' on the other?

The moment I take the @BatchSize annotation off, or the @Cache annotation off, everything's happy.

Similarly, I'm trying to use the query cache. A simple criteria query to pull back a campaign by a non-PK UID, I'm putting under cache region "query/campaignByUID" and a user query (used to poll to see if the user has permissions to view the campaign) also a criteria query, under cache region "query/userByUsername".

But when I try to execute these two queries in the same transaction, I get the exact same blow-uppage. 'fqn=/' despite my quite explicitly set cache regions. I turn off the query cache, or make either query un-cacheable and we're happy again.

I'm a veteran Hibernate user, but haven't had luck with the 2nd level caches yet. And I haven't really needed them much in the past. This is a different story, and eventually I gotta get this working. I'm sure I'll figure it out, but any of you experts out there than can lend a hand, I'd appreciate it.

Please let me know if I can provide more useful info. Stack traces, code, configs, etc.

Thanks in advance.

-Falken


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.