Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12323

Index creation error in Oracle 12.1 and below

    XMLWordPrintable

Details

    • Hide

      For example is my case. I use Infinispan for caching relational database. I am using the existing table names to create their caches. In Infinispan JDBC persistence configuration I use very short table prefix: prefix="G". I have two tables PACK_GROUP_UNIT and PACK_GROUP_UNIT_KEYS. For them method OracleTableManager .getIndexName() tries to create two identical index with name
      "segment_index_r_pack_group_uni". Naturally, the first attempt is successful, and the second fails.

      Workaround only one. I should use shorter names for caches. But it means that I should create some mapping between table names and they's cache names. It complicate my code, that isn't good.

      I suggest two variants for improving code of Infinispan:
      1. We can just set up more shorter value for constant "segmentIndexExt". For example just "SI" and for symmetry "TI" for constant timestampIndexExt. But it's may be not good for backward compatibility. But index names usually don't uses directly...

      2. Change code of method OracleTableManager.getIndexName() for using own short prefixes for indexes instead of cutting end of table name. I think it is better and safed way. I plan to create little patch for it tomorrow and place it here.

      Show
      For example is my case. I use Infinispan for caching relational database. I am using the existing table names to create their caches. In Infinispan JDBC persistence configuration I use very short table prefix: prefix="G". I have two tables PACK_GROUP_UNIT and PACK_GROUP_UNIT_KEYS. For them method OracleTableManager .getIndexName() tries to create two identical index with name "segment_index_r_pack_group_uni". Naturally, the first attempt is successful, and the second fails. Workaround only one. I should use shorter names for caches. But it means that I should create some mapping between table names and they's cache names. It complicate my code, that isn't good. I suggest two variants for improving code of Infinispan: 1. We can just set up more shorter value for constant "segmentIndexExt". For example just "SI" and for symmetry "TI" for constant timestampIndexExt. But it's may be not good for backward compatibility. But index names usually don't uses directly... 2. Change code of method OracleTableManager.getIndexName() for using own short prefixes for indexes instead of cutting end of table name. I think it is better and safed way. I plan to create little patch for it tomorrow and place it here.

    Description

      I use JDBC cache store in Oracle 11.2.  It works fine with Infinispan 9.4, but isn't work with Infinispan 11. Infinispan can't create appropriate indexes because they's names has dublicates during creation stage.

      Reason of this problem is the code which don't generate properly names of indexes. In the Oracle database version 12.1 and below maximum length of table or index name is 30 characters.

      The constant segmentIndexExt which exists in the class org.infinispan.persistence.jdbc.impl.table.AbstractTableManager has value "segment_index" which is already 13 characters long.

      Method getIndexName() of class org.infinispan.persistence.jdbc.impl.table.OracleTableManager generates index name using concatenation this constant and table name. If index name is longer that 30 characters then method cuts it at the end.

      Table name equals name of cache.

      In case when somebody need create two caches which names are mostly same and longer that 15 characters, Infinispan tries to create indexes with same name.

       

      Attachments

        Activity

          People

            ttarrant@redhat.com Tristan Tarrant
            c0ff75 Evgenii Balakhonov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: