5 Replies Latest reply on Mar 8, 2005 6:35 AM by Bela Ban

    problem with bdbje-cacheloader

    robert kubatz Newbie

      following the cacheloader tutorial
      in section 10.2. Replicated cache with shared datastore
      i try to use the BdbjeCacheLoader
      instead of the FileCacheLoader as follows:

      org.jboss.cache.loader.bdbje.BdbjeCacheLoader

      location=c:\\tmp\\bdbje


      I receive the following error
      if I trying to run the second process.
      ( both process are on the sam machine )

      - With filecacheloader it works.
      the stack dump
      com.sleepycat.je.log.LogException: A je..lckfile exists in c:\tmp\bdbje The environment can not be locked for single writer access.

      at com.sleepycat.je.log.FileManager.lockEnvironment(FileManager.java:941)
      at com.sleepycat.je.log.FileManager.(FileManager.java:137)
      at com.sleepycat.je.dbi.EnvironmentImpl.(EnvironmentImpl.java:168) at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:65)
      at com.sleepycat.je.Environment.(Environment.java:79)
      at org.jboss.cache.loader.bdbje.BdbjeCacheLoader.start(BdbjeCacheLoader.java:12
      7)

      at org.jboss.cache.TreeCache.startCacheLoader(TreeCache.java:1444)
      at org.jboss.cache.TreeCache.startService(TreeCache.java:1109)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.
      java:272)

      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:173)
      at org.jboss.cache.TreeCacheView2.main(TreeCacheView2.java:123)
      ? are any additional setting required or just not allowed?.
      Any help is appreciated.

      Cheers robitop.



        • 1. Re: problem with bdbje-cacheloader
          Bela Ban Master

          BDB does *not* support shared access to the same DB. There can be only 1 writer.

          Can't use BDB for this scenario

          • 2. Re: problem with bdbje-cacheloader
            robert kubatz Newbie

            Thank you, for this answer,
            though I am confused sleepycat advertices bdbje as
            "
            The architecture of Berkeley DB JE supports high
            performance and concurrency for both read-intensive
            and write-intensive workloads.

            Berkeley DB JE is available with the following feature sets to meet
            your application's needs.
            Berkeley DB JE Concurrent Data Store
            Multiple writers and readers.
            "
            would just be fantastic if it worked.

            cheers robitop

            • 3. Re: problem with bdbje-cacheloader
              Bela Ban Master

              go ask them, this is not what they told me. Please post the response here (I'm interested too)

              • 4. Re: problem with bdbje-cacheloader
                robert kubatz Newbie


                I asked sleepycat about the concurrency issues and
                got this reply

                ----------------------------------
                Provides bdbje concurrent access? what's the deal?
                >
                First let me explain the capabilities of JE itself, independently of
                JBossCache. For a given database environment, a single process may open
                that environment for write access at one time. Within than process, any
                number of threads may read and write concurrently. JE supports record
                locking and highly concurrent read and write access via multiple threads
                in a single process.

                I am not a JBossCache expert, so please take the following with a grain
                of salt and check with JBoss support for details. With JBossCache, I
                believe that multiple processes can be configured to share a single
                cache via replication. If you configure only one of those processes to
                be persistent, using JE as the persistence store, then I think the
                entire shared cache will be persistent. I'm not sure how this is
                configured, and as I say you'll need to check with JBoss support. But
                this type of configuration may be what you're looking for.

                -------
                Which actually says no concurrency with different processes.
                and *one* writer only.
                Actually in the dbdje docs there are some remarks.
                That it is possible to open a database for read , close it
                open it for write .., but this is painful


                cheers robitop

                • 5. Re: problem with bdbje-cacheloader
                  Bela Ban Master

                  So you can't have BDBJE as shared CacheLoader.
                  Solution: either only use BDBJE in *one* of the processes, or use them in unshared (local) mode. See the tutorial for an example.

                  Another solution might be to write a remote (RMI) interface to BDBJE and access it from multiple processes via RMI. That defeats the purpose of an in-memory DB though