You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Vijai Kalyan (JIRA)" <ji...@apache.org> on 2008/01/17 18:13:34 UTC

[jira] Created: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005

Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005
----------------------------------------------------------------------------------------------------

                 Key: JCR-1322
                 URL: https://issues.apache.org/jira/browse/JCR-1322
             Project: Jackrabbit
          Issue Type: Bug
          Components: clustering
    Affects Versions: 1.3.3
         Environment: Microsoft SQL Server 2005 on Windows Server. Database is setup to be case-sensitive.
            Reporter: Vijai Kalyan


After a call to Session::save, we observed that cluster information was not written to the ${schemaObjectPrefix}JOURNAL and ${schemaObjectPrefix}GLOBAL_REVISION tables. We tested against Oracle 10 database servers and MS Sql Server 2005 servers. The problem was noticed only with MS Sql Server 2005. 

Initially, the problem was masked since the test was written as part of our unit test environment and the exceptions generated by JDBC were not showing up in the logs. A separate test with was carried out as shown by the code below

<pre>
import java.io.FileInputStream;

import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;

import org.apache.jackrabbit.core.TransientRepository;
import org.apache.jackrabbit.core.config.RepositoryConfig;

public class Main
{
    public static void main(String[] args)
        throws Exception
    {
        System.setProperty("org.apache.jackrabbit.core.cluster.node_id", "testid");
        
        RepositoryConfig config = RepositoryConfig.create(new FileInputStream("repository.xml"), "repository");
        
        Repository repository = new TransientRepository();
        
        Session session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
        
        Node root = session.getRootNode();
        
        root.addNode("node1");
        root.addNode("node2");
        root.addNode("node3");
        
        session.save();
    }
}
</pre>

The configuration file used to configure the repository is attached.

After debugging this, we obtained the exceptions that were previously not visible. Note that, JackRabbit continues to run (is that because the cluster code is running in a separate thread?) even after this exception. The problem was that the 'revision_id' field did not exist. The mssql.ddl schema file sets up the table names in capitals. However, at least two of the SQL statements in DatabaseJournal use lower case table names. For example:-

<pre>
        updateGlobalStmt = con.prepareStatement(
                "update " + schemaObjectPrefix + "global_revision " +
                "set revision_id = revision_id + 1");
        selectGlobalStmt = con.prepareStatement(
                "select revision_id " +
                "from " + schemaObjectPrefix + "global_revision");
</pre>

An additional error is that the mssql.ddl file is missing the following:

<pre>
# Inserting the one and only revision counter record now helps avoiding race conditions
insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
</pre>

Fixing the above two issues, fixed the problem with MS SQL Server 2005.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-1322.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4.1

You're right, good point!

Fixed as suggested in revision 628291. Merged to the 1.4 branch in revision 628294.

> Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1322
>                 URL: https://issues.apache.org/jira/browse/JCR-1322
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering, jackrabbit-core
>    Affects Versions: 1.4
>         Environment: Microsoft SQL Server 2005 on Windows Server. Database is setup to be case-sensitive.
>            Reporter: Vijai Kalyan
>            Assignee: Jukka Zitting
>             Fix For: 1.4.1
>
>
> After a call to Session::save, we observed that cluster information was not written to the ${schemaObjectPrefix}JOURNAL and ${schemaObjectPrefix}GLOBAL_REVISION tables. We tested against Oracle 10 database servers and MS Sql Server 2005 servers. The problem was noticed only with MS Sql Server 2005. 
> Initially, the problem was masked since the test was written as part of our unit test environment and the exceptions generated by JDBC were not showing up in the logs. A separate test with was carried out as shown by the code below
> <pre>
> import java.io.FileInputStream;
> import javax.jcr.Node;
> import javax.jcr.Repository;
> import javax.jcr.Session;
> import javax.jcr.SimpleCredentials;
> import org.apache.jackrabbit.core.TransientRepository;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> public class Main
> {
>     public static void main(String[] args)
>         throws Exception
>     {
>         System.setProperty("org.apache.jackrabbit.core.cluster.node_id", "testid");
>         
>         RepositoryConfig config = RepositoryConfig.create(new FileInputStream("repository.xml"), "repository");
>         
>         Repository repository = new TransientRepository();
>         
>         Session session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
>         
>         Node root = session.getRootNode();
>         
>         root.addNode("node1");
>         root.addNode("node2");
>         root.addNode("node3");
>         
>         session.save();
>     }
> }
> </pre>
> The configuration file used to configure the repository is attached.
> After debugging this, we obtained the exceptions that were previously not visible. Note that, JackRabbit continues to run (is that because the cluster code is running in a separate thread?) even after this exception. The problem was that the 'revision_id' field did not exist. The mssql.ddl schema file sets up the table names in capitals. However, at least two of the SQL statements in DatabaseJournal use lower case table names. For example:-
> <pre>
>         updateGlobalStmt = con.prepareStatement(
>                 "update " + schemaObjectPrefix + "global_revision " +
>                 "set revision_id = revision_id + 1");
>         selectGlobalStmt = con.prepareStatement(
>                 "select revision_id " +
>                 "from " + schemaObjectPrefix + "global_revision");
> </pre>
> An additional error is that the mssql.ddl file is missing the following:
> <pre>
> # Inserting the one and only revision counter record now helps avoiding race conditions
> insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
> </pre>
> Fixing the above two issues, fixed the problem with MS SQL Server 2005.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005

Posted by "Vijai Kalyan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vijai Kalyan updated JCR-1322:
------------------------------

    Affects Version/s:     (was: 1.3.3)
                       1.4

You are correct. The revision number should be 1.4. Our local version is 1.3.3 patched with the various changes.

I am referring to the following lines in DatabaseJournal.java (http://svn.apache.org/repos/asf/jackrabbit/tags/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java)

        updateGlobalStmtSQL =
                "update " + schemaObjectPrefix + "GLOBAL_REVISION " +
                "set revision_id = revision_id + 1";
        selectGlobalStmtSQL =
                "select revision_id " +

Note the lower case column names for 'revision_id'. These are created in upper case however.

> Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1322
>                 URL: https://issues.apache.org/jira/browse/JCR-1322
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.4
>         Environment: Microsoft SQL Server 2005 on Windows Server. Database is setup to be case-sensitive.
>            Reporter: Vijai Kalyan
>
> After a call to Session::save, we observed that cluster information was not written to the ${schemaObjectPrefix}JOURNAL and ${schemaObjectPrefix}GLOBAL_REVISION tables. We tested against Oracle 10 database servers and MS Sql Server 2005 servers. The problem was noticed only with MS Sql Server 2005. 
> Initially, the problem was masked since the test was written as part of our unit test environment and the exceptions generated by JDBC were not showing up in the logs. A separate test with was carried out as shown by the code below
> <pre>
> import java.io.FileInputStream;
> import javax.jcr.Node;
> import javax.jcr.Repository;
> import javax.jcr.Session;
> import javax.jcr.SimpleCredentials;
> import org.apache.jackrabbit.core.TransientRepository;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> public class Main
> {
>     public static void main(String[] args)
>         throws Exception
>     {
>         System.setProperty("org.apache.jackrabbit.core.cluster.node_id", "testid");
>         
>         RepositoryConfig config = RepositoryConfig.create(new FileInputStream("repository.xml"), "repository");
>         
>         Repository repository = new TransientRepository();
>         
>         Session session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
>         
>         Node root = session.getRootNode();
>         
>         root.addNode("node1");
>         root.addNode("node2");
>         root.addNode("node3");
>         
>         session.save();
>     }
> }
> </pre>
> The configuration file used to configure the repository is attached.
> After debugging this, we obtained the exceptions that were previously not visible. Note that, JackRabbit continues to run (is that because the cluster code is running in a separate thread?) even after this exception. The problem was that the 'revision_id' field did not exist. The mssql.ddl schema file sets up the table names in capitals. However, at least two of the SQL statements in DatabaseJournal use lower case table names. For example:-
> <pre>
>         updateGlobalStmt = con.prepareStatement(
>                 "update " + schemaObjectPrefix + "global_revision " +
>                 "set revision_id = revision_id + 1");
>         selectGlobalStmt = con.prepareStatement(
>                 "select revision_id " +
>                 "from " + schemaObjectPrefix + "global_revision");
> </pre>
> An additional error is that the mssql.ddl file is missing the following:
> <pre>
> # Inserting the one and only revision counter record now helps avoiding race conditions
> insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
> </pre>
> Fixing the above two issues, fixed the problem with MS SQL Server 2005.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1322:
-------------------------------

    Component/s: jackrabbit-core
       Assignee: Jukka Zitting

> Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1322
>                 URL: https://issues.apache.org/jira/browse/JCR-1322
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering, jackrabbit-core
>    Affects Versions: 1.4
>         Environment: Microsoft SQL Server 2005 on Windows Server. Database is setup to be case-sensitive.
>            Reporter: Vijai Kalyan
>            Assignee: Jukka Zitting
>
> After a call to Session::save, we observed that cluster information was not written to the ${schemaObjectPrefix}JOURNAL and ${schemaObjectPrefix}GLOBAL_REVISION tables. We tested against Oracle 10 database servers and MS Sql Server 2005 servers. The problem was noticed only with MS Sql Server 2005. 
> Initially, the problem was masked since the test was written as part of our unit test environment and the exceptions generated by JDBC were not showing up in the logs. A separate test with was carried out as shown by the code below
> <pre>
> import java.io.FileInputStream;
> import javax.jcr.Node;
> import javax.jcr.Repository;
> import javax.jcr.Session;
> import javax.jcr.SimpleCredentials;
> import org.apache.jackrabbit.core.TransientRepository;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> public class Main
> {
>     public static void main(String[] args)
>         throws Exception
>     {
>         System.setProperty("org.apache.jackrabbit.core.cluster.node_id", "testid");
>         
>         RepositoryConfig config = RepositoryConfig.create(new FileInputStream("repository.xml"), "repository");
>         
>         Repository repository = new TransientRepository();
>         
>         Session session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
>         
>         Node root = session.getRootNode();
>         
>         root.addNode("node1");
>         root.addNode("node2");
>         root.addNode("node3");
>         
>         session.save();
>     }
> }
> </pre>
> The configuration file used to configure the repository is attached.
> After debugging this, we obtained the exceptions that were previously not visible. Note that, JackRabbit continues to run (is that because the cluster code is running in a separate thread?) even after this exception. The problem was that the 'revision_id' field did not exist. The mssql.ddl schema file sets up the table names in capitals. However, at least two of the SQL statements in DatabaseJournal use lower case table names. For example:-
> <pre>
>         updateGlobalStmt = con.prepareStatement(
>                 "update " + schemaObjectPrefix + "global_revision " +
>                 "set revision_id = revision_id + 1");
>         selectGlobalStmt = con.prepareStatement(
>                 "select revision_id " +
>                 "from " + schemaObjectPrefix + "global_revision");
> </pre>
> An additional error is that the mssql.ddl file is missing the following:
> <pre>
> # Inserting the one and only revision counter record now helps avoiding race conditions
> insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
> </pre>
> Fixing the above two issues, fixed the problem with MS SQL Server 2005.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560377#action_12560377 ] 

Jukka Zitting commented on JCR-1322:
------------------------------------

Which database schema file are you using? The mssql.ddl file that you refer to was only included in Jackrabbit 1.4, but this issue is marked for 1.3.3.

Also, the mssql.ddl in Jackrabbit 1.4 creates all tables with upper case names and contains the initial INSERT to the GLOBAL_REVISION table.

> Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1322
>                 URL: https://issues.apache.org/jira/browse/JCR-1322
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.3.3
>         Environment: Microsoft SQL Server 2005 on Windows Server. Database is setup to be case-sensitive.
>            Reporter: Vijai Kalyan
>
> After a call to Session::save, we observed that cluster information was not written to the ${schemaObjectPrefix}JOURNAL and ${schemaObjectPrefix}GLOBAL_REVISION tables. We tested against Oracle 10 database servers and MS Sql Server 2005 servers. The problem was noticed only with MS Sql Server 2005. 
> Initially, the problem was masked since the test was written as part of our unit test environment and the exceptions generated by JDBC were not showing up in the logs. A separate test with was carried out as shown by the code below
> <pre>
> import java.io.FileInputStream;
> import javax.jcr.Node;
> import javax.jcr.Repository;
> import javax.jcr.Session;
> import javax.jcr.SimpleCredentials;
> import org.apache.jackrabbit.core.TransientRepository;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> public class Main
> {
>     public static void main(String[] args)
>         throws Exception
>     {
>         System.setProperty("org.apache.jackrabbit.core.cluster.node_id", "testid");
>         
>         RepositoryConfig config = RepositoryConfig.create(new FileInputStream("repository.xml"), "repository");
>         
>         Repository repository = new TransientRepository();
>         
>         Session session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
>         
>         Node root = session.getRootNode();
>         
>         root.addNode("node1");
>         root.addNode("node2");
>         root.addNode("node3");
>         
>         session.save();
>     }
> }
> </pre>
> The configuration file used to configure the repository is attached.
> After debugging this, we obtained the exceptions that were previously not visible. Note that, JackRabbit continues to run (is that because the cluster code is running in a separate thread?) even after this exception. The problem was that the 'revision_id' field did not exist. The mssql.ddl schema file sets up the table names in capitals. However, at least two of the SQL statements in DatabaseJournal use lower case table names. For example:-
> <pre>
>         updateGlobalStmt = con.prepareStatement(
>                 "update " + schemaObjectPrefix + "global_revision " +
>                 "set revision_id = revision_id + 1");
>         selectGlobalStmt = con.prepareStatement(
>                 "select revision_id " +
>                 "from " + schemaObjectPrefix + "global_revision");
> </pre>
> An additional error is that the mssql.ddl file is missing the following:
> <pre>
> # Inserting the one and only revision counter record now helps avoiding race conditions
> insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
> </pre>
> Fixing the above two issues, fixed the problem with MS SQL Server 2005.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.