Project

General

Profile

Actions

bug #9615

open

Options for schema creation in empty data bases.

Added by Andreas Kohlbecker almost 3 years ago. Updated about 2 years ago.

Status:
New
Priority:
Highest
Category:
cdmserver
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Severity:
normal
Found in Version:

Description

stack trace from cdmlib-remote-webapp startup:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is eu.etaxonomy.cdm.database.CdmDatabaseException: Case type (camel, upper, lower) of the database could be defined. Maybe the CdmMetaData table is missing in the datasource
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    ... 53 more
Caused by: eu.etaxonomy.cdm.database.CdmDatabaseException: Case type (camel, upper, lower) of the database could be defined. Maybe the CdmMetaData table is missing in the datasource
    at eu.etaxonomy.cdm.database.update.CaseType.caseTypeOfDatasource(CaseType.java:71)
    at eu.etaxonomy.cdm.database.update.CdmUpdater.updateToCurrentVersion(CdmUpdater.java:81)
    at eu.etaxonomy.cdm.opt.config.DataSourceConfigurer.dataSource(DataSourceConfigurer.java:271)
    at eu.etaxonomy.cdm.opt.config.DataSourceConfigurer$$EnhancerBySpringCGLIB$$a474cd6a.CGLIB$dataSource$5(<generated>)
    at eu.etaxonomy.cdm.opt.config.DataSourceConfigurer$$EnhancerBySpringCGLIB$$a474cd6a$$FastClassBySpringCGLIB$$a97e612b.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
    at eu.etaxonomy.cdm.opt.config.DataSourceConfigurer$$EnhancerBySpringCGLIB$$a474cd6a.dataSource(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    ... 54 more
Caused by: java.sql.SQLSyntaxErrorException: Table 'cdm_tmp.cdmmetadata' doesn't exist
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:353)
    at eu.etaxonomy.cdm.database.WrappedCdmDataSource.executeQuery(WrappedCdmDataSource.java:354)
    at eu.etaxonomy.cdm.database.update.CaseType.caseTypeOfDatasource(CaseType.java:69)
    ... 66 more

We need three things:

  • Document this option in the setup guides (redmine wiki and cybertaxonomy.org site)
  • Implement option to create the schema from the cdm-server management console - needed for manual setup by humans
  • Implement option to create the schema from the command line - needed for automatic setup e.g. in docker environments for workshops etc.

NOTEs

  • The management console should check is the database is empty, that is if there is only the _c3p0ConnectionTest table
  • The CaseType.caseTypeOfDatasource() should perform some more checks in case of "Table 'cdm_tmp.cdmmetadata' doesn't exist" and report an supposibly empty uninitialized cdm-db with a special Exception which is subclass of CdmDatabaseException ==> create cdmlib ticket #....
  • how will this work in multitenency situations?

Files

picture914-1.png (13.7 KB) picture914-1.png Andreas Müller, 05/08/2021 01:11 AM
Actions #1

Updated by Andreas Kohlbecker almost 3 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kohlbecker almost 3 years ago

  • Description updated (diff)
Actions #3

Updated by Andreas Müller almost 3 years ago

The required functionality exists in the taxeditor:

therefore I suggest to close this ticket as worksforme.

Definetely it is not a but, but if we also want to have the functionality in the CDM Server we may change this ticket to a feature request for CdmServer (if such a ticket does not exist yet).

Actions #4

Updated by Andreas Kohlbecker almost 3 years ago

  • Subject changed from cdmlib fails creating a new database to Opttions for schema creation in empty data bases.
  • Description updated (diff)
  • Category changed from cdmlib to cdmserver
  • Status changed from Feedback to New
  • Target version changed from Unassigned CDM tickets to Release 5.45

Thank you for this hint. The cdmlib-remote will create the schema creation when the parameter cdm.forceSchemaCreate is set to true.

We need three things:

  • Document this option in the setup guides (redmine wiki and cybertaxonomy.org site)
  • Implement option to create the schema from the cdm-server management console - needed for manual setup by humans
  • Implement option to create the schema from the command line - needed for automatic setup e.g. in docker environments for workshops etc.

I am changing the subject and description of this ticket accordingly

Actions #5

Updated by Andreas Kohlbecker almost 3 years ago

  • Priority changed from New to Highest
Actions #6

Updated by Andreas Müller about 2 years ago

  • Subject changed from Opttions for schema creation in empty data bases. to Options for schema creation in empty data bases.
Actions

Also available in: Atom PDF