[jboss-jira] [JBoss JIRA] Commented: (JGRP-1345) JDBC_PING fails to initialize table in mysql

Raúl Raja Martínez (JIRA) jira-events at lists.jboss.org
Thu Jul 14 13:46:23 EDT 2011


    [ https://issues.jboss.org/browse/JGRP-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614249#comment-12614249 ] 

Raúl Raja Martínez commented on JGRP-1345:
------------------------------------------

I agree with you, I think your SQL is correct, just pointing out that it may be a common problem for many people. Thanks for updating the docs.
As for the code in 2.12.0.Final this is the code for initializing the table.

 protected void attemptSchemaInitialization() {
        if (stringIsEmpty(initialize_sql)) {
            log.info("Table creation step skipped: initialize_sql property is missing");
            return;
        }
        Connection connection = getConnection();
        if (connection != null) {
            try {
                try {
                    PreparedStatement preparedStatement =
                        connection.prepareStatement(initialize_sql);
                    preparedStatement.execute();
                    log.info("Table created for JDBC_PING Discovery Protocol");
                } catch (SQLException e) {
                    if (log.isDebugEnabled()) {
                        log.debug("Could not execute initialize_sql statement; not necessarily an error.", e);
                    }
                    else {
                        //avoid printing out the stacktrace
                        log.info("Could not execute initialize_sql statement; not necessarily an error. Set to debug logging level for details.");
                    }
                }
            } finally {
                try {
                    connection.close();
                } catch (SQLException e) {
                    log.error("Error closing connection", e);
                }
            }
        }
    }

The catch statement does not print to error so the error is not apparent unless you have debug turned on.

> JDBC_PING fails to initialize table in mysql
> --------------------------------------------
>
>                 Key: JGRP-1345
>                 URL: https://issues.jboss.org/browse/JGRP-1345
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.12
>            Reporter: Raúl Raja Martínez
>            Assignee: Sanne Grinovero
>             Fix For: 2.12.2, 3.0
>
>
> JDBC_PING fails to initialize DB table for discover when executing the following SQL:
> CREATE TABLE JGROUPSPING (own_addr varchar(200) NOT NULL, cluster_name varchar(200) NOT NULL, ping_data varbinary(5000) DEFAULT NULL, PRIMARY KEY (own_addr, cluster_name) )
> The statement results in "Specified key was too long; max key length is 1000 bytes"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jboss-jira mailing list