Uploaded image for project: 'Spring Data for Apache Cassandra'
  1. Spring Data for Apache Cassandra
  2. DATACASS-219

On startup CREATE TABLE from entities should only add 'if not exists'.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 GA (Fowler), 1.4.1 (Hopper SR1)
    • Component/s: Core
    • Labels:
      None

      Description

      When setting schema-action=create, the creation of the column family on startup from the entity mapping works only when the table does not already exists. As a consequence, a spring data cassandra app starts up properly and creates the table on its very first startup but will consequently crash on subsequent startups with an AlreadyExistsException.

      This happens because CassandraSessionFactoryBean does not ad the "if not exists" on table creation - line 99 https://github.com/spring-projects/spring-data-cassandra/blob/master/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/CassandraSessionFactoryBean.java#L99

      Here's a PR to remedy this : https://github.com/spring-projects/spring-data-cassandra/pull/40

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jblum John Blum
                Reporter:
                nicolasyanncouturier Nicolas Yann Couturier
                Last updater:
                Mark Paluch
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 47 weeks, 1 day ago