I have a web application and a component have to access infinispan wich runs on another JVM. So, I coded this:
Configuration config = new ConfigurationBuilder().addServer()
RemoteCacheManager rcm = new RemoteCacheManager(config, true);
RemoteCache cache = rcm.getCache();
Untill now, everything is OK. But, when I shutdown and restart the Infinispan server I lose whole data sent to cache. Thats my problem. I want to instruct the database to write to disk, but have not found how to configure this behavior.
Sounds like you did not add any persistence. There is no persistence configured automaticaly.
Could you share a simple example what you are doing?
Until now, I have dedicated me to the Persistence chapter of the documentation, but there is a lot of configurations and does not makes clear where and which file could I do such settings. The one configuration file I have know is the "standalone.xml", but the docs does not specify where can I do that. For instance: I can setting my JBoss7 behavior editing standalone.xml or through manager console on URL by borwser on http://localhost:9990, and I dont found something like it on Infinispan. So, is there a manager console to setting my Infinispan? Is standalone.xml the only file to do that?
Could you elaborate what you are doing?
I did not understand what you try to achieve? Did you want to configure the cache inside your application or do you run a JBoss server and want to configure the cache from here?
I downloaded HotRod client service (infinispan-server-6.0.0.Final-bin.zip) and I found a file structure seems like to JBoss7 structure such stanalone, deployment and configuration directories. Well, I started up the server running standalone.bat through command line and everything is OK. I think the Infinispan has some administration panel do to some settings, seems like JBoss7, but I can still not find it. On summarizing I should to do:
1) I looking for a admin console or configurations file .xml to make my Infinispan persistente database, not just in memory data.
Ok, you use a infinispan server.
That mean you have a server which is based on AS7, but there is no CLI like in AS7. This is different.
If you want to have a persistent cache and try to access it remote you should have a look to this quickstart Use JDG remotely through Hotrod
Here you find the configuration and access explained step by step.
Hope that helps
OK, I did everything tutorial tell me to do. I defined my datasource like that:
<datasource jta="false" jndi-name="java:jboss/datasources/infinispan" pool-name="InfinispanDS" enabled="true" use-ccm="false">
and defined my cache as a follow:
<local-cache name="teams" start="EAGER" batching="false" >
<locking isolation="REPEATABLE_READ" acquire-timeout="20000" concurrency-level="500" striping="false" />
<transaction mode="NONE" />
<string-keyed-jdbc-store datasource="InfinispanDS" passivation="false" preload="false" purge="false">
<id-column name="id" type="VARCHAR" />
<data-column name="datum" type="BINARY" />
<timestamp-column name="version" type="BIGINT" />
I installed postgresql driver as a module like AS7 recommends to do and started up JDG running standalone.bat command line. I made a client do make consume data cached via hot rod protocol and I got it! But I think data inserted on cache through cach.put() method will be inserted on database which was defined on datasource. What I did forget to do?
First you need to check whether the module is loaded correct, you see a message that the driver is loaded.
After that the DS need to be installed.
If the cache is initialized the table should be in your DB.
Did you see errors? Also you might enable org.infinispan=TRACE to see more information
I suppose the <string.keyed.... datasource= will be the issue if I look to my configuration you should use "java:jboss/datasources/infinispan"
Just one more question: the table was created but data inserted into remote cache object there is not into table. Is there some attribute we forget?
For me this example hotrod-endpoint work. I did not see any problem from your configuration.
Maybe you enable TRACE for org.infinispan for the logging subsystem in your configuration to see the SQL's.
Also you might try the quickstart and compare it to your's
Hi Wolf-Dieter, I created a named cache by doing something like that
new RemoteCacheManager(config, true).getCache("mycache");
and I everything is OK.
Thanks a lot...