karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Lamy (*$^¨%`£) (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-2523) Karaf JDBC lock doesn't word with M$ SQLServer
Date Mon, 21 Oct 2013 01:44:41 GMT

    [ https://issues.apache.org/jira/browse/KARAF-2523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800300#comment-13800300
] 

Olivier Lamy (*$^¨%`£) commented on KARAF-2523:
-----------------------------------------------

Got it working creating the class (NOTE: as methods are package private the class need to
be in the package org.apache.karaf.main)
Class:

public class MSSqlJdbcLock
    extends DefaultJDBCLock
{
    public MSSqlJdbcLock( Properties props )
    {
        super( props );
    }
 
    Statements createStatements()
    {
        Statements statements = new MSSqlStatements();
        return statements;
    }
 
 
    private class MSSqlStatements
        extends Statements
    {
        public String getLockCreateStatement()
        {
            return "SELECT * FROM " + getFullLockTableName();
        }
    }
 
}

> Karaf JDBC lock doesn't word with M$ SQLServer
> ----------------------------------------------
>
>                 Key: KARAF-2523
>                 URL: https://issues.apache.org/jira/browse/KARAF-2523
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.3.0
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 2.4.0, 3.0.0, 2.3.4
>
>
> Using the M$ SQLServer (with jtds) as lock backend (and the Karaf default JDBC lock implementation)
with this configuration:
> #setup in system.properties
>  
> karaf.lock=true
> karaf.lock.class=org.apache.karaf.main.DefaultJDBCLock
> karaf.lock.level=50
> karaf.lock.delay=10
> karaf.lock.jdbc.url=jdbc:jtds:sqlserver://xxx;databaseName=evillarr
> karaf.lock.jdbc.driver=net.sourceforge.jtds.jdbc.Driver
> karaf.lock.jdbc.user=xxx
> karaf.lock.jdbc.password=xxx
> karaf.lock.jdbc.table=KARAF_LOCK
> karaf.lock.jdbc.clustername=karaf
> karaf.lock.jdbc.timeout=30
>  
> Karaf doesn't start because it can't acquire the lock:
>  
> 2013-10-21 09:47:42 | WARN | Thread-28 | - - | Failed to acquire database lock: java.sql.SQLException:
Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
> As SQLServer doesn't support the "select ... for update" statement, we have to provide
a MSSQLServerLock implementation using a different SQL query.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message