-
1. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
daniel.celentano Jan 30, 2009 4:11 PM (in response to navssurtani)I like to congratulate for the release. And I want to make a question.
Is possible to use JCS with hibernate second level cache?
Thanks,
Daniel -
2. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
manik Feb 2, 2009 7:13 AM (in response to navssurtani)Why would you want to do that?
The only reason anyone would want to use JBCS is to be able to run queries on cached objects. If you are using Hibernate, Hiberate's HQL will already allow you to run queries so you don't need JBCS. JBossCache-core is all you really need. -
3. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
daniel.celentano Feb 2, 2009 1:57 PM (in response to navssurtani)Manik,
I'm thinking on this use case ...
When I start the JBoss server I run a script to get every Person entity on the cache.
I would like to select a Person based on user input without reaching the database server. Is this possible using only the cache?
Thanks in advace,
Daniel -
4. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
manik Feb 2, 2009 2:48 PM (in response to navssurtani)Sure - hibernate HQL queries will do this for you, provided you have enabled query and entity caching.
-
5. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
daniel.celentano Feb 2, 2009 3:43 PM (in response to navssurtani)My poor English is limiting my explanation...
I only want to hit the DB server with the script, not every time a user make a request because I have thousands of concurrent access crashing my DB server. The problem with your suggestion is that the queries change depending on user's input so it misses the query cache.
Thanks,
Daniel -
6. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
manik Feb 2, 2009 4:02 PM (in response to navssurtani)So you want to preload the entity cache? JBCS won't help you with that. :)
I suggest you write a startup script that requests for all of the entities using a Hibernate session, so this makes sure all of the entities are cached before people start using the system. This is more a discussion for the Hibernate user forum, TBH. :) -
7. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
daniel.celentano Feb 2, 2009 4:45 PM (in response to navssurtani)Thank you for your quick reply.
I know Hibernate can't help me with this problem. I know because I was Hibernate instructor in South America.
I'm thinking in using JBCS in some way to resolve this problem. I'm working on a prototype, if you are interested I can share it ... when I get it working.
Tks,
Daniel -
8. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
manik Feb 2, 2009 5:15 PM (in response to navssurtani)Sure, will be interested to know. :)
-
9. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
daniel.celentano Mar 2, 2009 9:15 AM (in response to navssurtani)Manik,
I make a prototype with JBCS as stand-alone application and it work perfect.
But when I try to run it inside JBoss AS I'm always getting same exception.
I'm lost. Could you help me?
Tks,
Daniel
Exception is:
java.lang.VerifyError: (class: org/jboss/cache/config/Configuration, method: setCacheLoaderConfig signature: (Lorg/jboss/cache/config/CacheLoaderConfig;)V) Incompatible argument to function)
code is:
CacheFactory<String, String> factory = new DefaultCacheFactory<String, String>();
Cache cache = factory.createCache(config); -
10. Re: JBoss Cache Searchable 1.0.0.BETA1 out !!
manik Mar 2, 2009 10:02 AM (in response to navssurtani)Which version of JBoss AS is this? Also do you package jbosscache-core in your WAR or EAR?