2 Replies Latest reply on Mar 11, 2013 4:34 AM by serdar

    JDBC based cache loaders rowlock guaranty ?

    serdar

      Hi,

       

      Does infinispan guaranty that JDBC based cache loader(i.e JdbcStringBasedCacheStore) makes the Relatinal Database Management System(RDMS) use a rowlock update duiring the transactions ? I know that there is no way to force the relational database to chose a rowlock or page-lock in its transaction isolation. But there are some ways to guide the RDMS, for example indexing the pages and updating the rows by indexed where clause or reading the results by a READ_COMMIT isolation level etc.. 

       

      I assume that infinispan choses the proper JDBC connection isolation levels and create the pages in proper way while updating the database so the relational database (i.e MySQL or MSSQL) uses ROWLOCK updates so concurrent updates for different keys dont lock eack other ? am I right ?

        • 1. Re: JDBC based cache loaders rowlock guaranty ?
          sannegrinovero

          Infinispan does not set any connection isolation level, you can configure that in your jdbc datasource or pool configuration, but you don't stricly need to:

           

          Infinispan acquires in-memory locks making sure it never writes to the same entry at the same time, so in practical terms the isolation and locking level of the database are not affecting it.

          • 2. Re: JDBC based cache loaders rowlock guaranty ?
            serdar

            in a synchronized cache store, lock of the datastore should also lock the infinispan cache I think... Ok infinispan writes the different entries but these entries are at the same table in the cache store database and it may couse a page lock at the datastore I think ?