Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 8777 invoked from network); 16 Feb 2008 13:35:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2008 13:35:32 -0000 Received: (qmail 71945 invoked by uid 500); 16 Feb 2008 13:35:24 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 71910 invoked by uid 500); 16 Feb 2008 13:35:24 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 71836 invoked by uid 99); 16 Feb 2008 13:35:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Feb 2008 05:35:23 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Feb 2008 13:35:00 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E5E04714084 for ; Sat, 16 Feb 2008 05:35:08 -0800 (PST) Message-ID: <8774120.1203168908939.JavaMail.jira@brutus> Date: Sat, 16 Feb 2008 05:35:08 -0800 (PST) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-1322) Cluster information is not persisted to database when connected to case sensitive MS SQL Server 2005 In-Reply-To: <2222083.1200590014076.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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 >
> 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();
>     }
> }
> 
> 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:- >
>         updateGlobalStmt = con.prepareStatement(
>                 "update " + schemaObjectPrefix + "global_revision " +
>                 "set revision_id = revision_id + 1");
>         selectGlobalStmt = con.prepareStatement(
>                 "select revision_id " +
>                 "from " + schemaObjectPrefix + "global_revision");
> 
> An additional error is that the mssql.ddl file is missing the following: >
> # Inserting the one and only revision counter record now helps avoiding race conditions
> insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
> 
> 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.