Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 2 contributors
Aug 02, 2012
Andreas Pieber [KARAF-1666] Fixed another jetty problem with acceptors and blocking …
…connectors

Signed-off-by: Andreas Pieber <anpieber@gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/karaf/trunk@1368388 13f79535-47bb-0310-9956-ffa450edef68
c5ca1dc
[KARAF-447] Add JDBC lock implementation for PostgreSQL
Update to tests.



git-svn-id: https://svn.apache.org/repos/asf/karaf/trunk@1368406 13f79535-47bb-0310-9956-ffa450edef68
aad32f8
[KARAF-1700] update manual to reflect JDBC Lock updates
Update to locking manual. Thank you for the patch Heath Kesler.



git-svn-id: https://svn.apache.org/repos/asf/karaf/trunk@1368408 13f79535-47bb-0310-9956-ffa450edef68
fc8a1a6
2  assemblies/apache-karaf/src/main/resources/extra/jetty.xml
@@ -45,7 +45,7 @@ DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
45 45
                     <Property name="jetty.port" default="8181"/>
46 46
                 </Set>
47 47
                 <Set name="maxIdleTime">300000</Set>
48  
-                <Set name="Acceptors">2</Set>
  48
+                <Set name="Acceptors">1</Set>
49 49
                 <Set name="statsOn">false</Set>
50 50
                 <Set name="confidentialPort">8443</Set>
51 51
             </New>
4  main/src/test/java/org/apache/karaf/main/lock/PostgreSQLJDBCLockIntegrationTest.java
@@ -35,7 +35,7 @@
35 35
     public void setUp() throws Exception {
36 36
         password = "secret";
37 37
         driver = "org.postgresql.Driver";
38  
-        url = "jdbc:derby://127.0.0.1:5432/test";
  38
+        url = "jdbc:postgresql://127.0.0.1:5432/test";
39 39
         
40 40
         super.setUp();
41 41
     }
@@ -48,7 +48,7 @@ PostgreSQLJDBCLock createLock(Properties props) {
48 48
     @Test
49 49
     public void initShouldCreateTheDatabaseIfItNotExists() throws Exception {
50 50
         String database = "test" + System.currentTimeMillis();
51  
-        url = "jdbc:derby://127.0.0.1:5432/" + database;
  51
+        url = "jdbc:postgresql://127.0.0.1:5432/" + database;
52 52
         props.put("karaf.lock.jdbc.url", url);
53 53
         lock = createLock(props);
54 54
         lock.lock();
6  main/src/test/java/org/apache/karaf/main/lock/PostgreSQLJDBCLockTest.java
@@ -38,7 +38,7 @@
38 38
     public void setUp() throws Exception {
39 39
         password = "secret";
40 40
         driver = "org.postgresql.Driver";
41  
-        url = "jdbc:derby://127.0.0.1:5432/test";
  41
+        url = "jdbc:postgresql://127.0.0.1:5432/test";
42 42
         
43 43
         super.setUp();
44 44
     }
@@ -48,7 +48,7 @@ DefaultJDBCLock createLock(Properties props) {
48 48
             @Override
49 49
             Connection doCreateConnection(String driver, String url, String username, String password) {
50 50
                 assertEquals(this.driver, driver);
51  
-                assertEquals(this.url + ";create=true", url);
  51
+                assertEquals(this.url, url);
52 52
                 assertEquals(this.user, username);
53 53
                 assertEquals(this.password, password);
54 54
                 return connection;
@@ -69,7 +69,7 @@ public void createConnectionShouldConcatinateOptionsCorrect() {
69 69
             @Override
70 70
             Connection doCreateConnection(String driver, String url, String username, String password) {
71 71
                 assertEquals(this.driver, driver);
72  
-                assertEquals(this.url + ";create=true", url);
  72
+                assertEquals(this.url, url);
73 73
                 assertEquals(this.user, username);
74 74
                 assertEquals(this.password, password);
75 75
                 return connection;
60  manual/src/main/webapp/users-guide/failover.conf
@@ -57,7 +57,7 @@ Otherwise, configure the system.properties file as normal for your setup, for ex
57 57
 
58 58
 {noformat}
59 59
 karaf.lock=true
60  
-karaf.lock.class=org.apache.karaf.main.OracleJDBCLock
  60
+karaf.lock.class=org.apache.karaf.main.lock.OracleJDBCLock
61 61
 karaf.lock.jdbc.url=jdbc:oracle:thin:@hostname:1521:XE
62 62
 karaf.lock.jdbc.driver=oracle.jdbc.OracleDriver
63 63
 karaf.lock.jdbc.user=user
@@ -73,15 +73,61 @@ As with the default JDBC locking setup, the Oracle JDBC driver JAR file must be
73 73
 
74 74
 h3. Derby
75 75
 
76  
-{warning}
77  
-TODO
78  
-{warning}
  76
+The same rules apply when using derby.  Make sure you have the driver jar file in the Karaf {{lib}} folder before starting Karaf.
  77
+
  78
+Then make you update the properties in {{$KARAF_HOME/etc/system.properties}} to look something like this example:
  79
+
  80
+{noformat}
  81
+karaf.lock=true
  82
+karaf.lock.class=org.apache.karaf.main.lock.DerbyJDBCLock
  83
+karaf.lock.jdbc.url=jdbc:derby://127.0.0.1:1527/dbname
  84
+karaf.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver
  85
+karaf.lock.jdbc.user=user
  86
+karaf.lock.jdbc.password=password
  87
+karaf.lock.jdbc.table=KARAF_LOCK
  88
+karaf.lock.jdbc.clustername=karaf
  89
+karaf.lock.jdbc.timeout=30
  90
+{noformat}
79 91
 
80 92
 h3. MySQL
81 93
 
82  
-{warning}
83  
-TODO
84  
-{warning}
  94
+Make sure you have the MySQL driver jar file in the Karaf {{lib}} folder before starting Karaf.
  95
+
  96
+*NOTE*: for 2.2.x, 2.3.x, 3.0.x you need to rename the MySQL Driver jar to prefix with 'karaf-' in order for karaf to pick it up, otherwise you will see karaf just hang on startup and the log will show you that it could not find the driver.
  97
+
  98
+Then make you update the properties in {{$KARAF_HOME/etc/system.properties}} to look something like this example:
  99
+
  100
+{noformat}
  101
+karaf.lock=true
  102
+karaf.lock.class=org.apache.karaf.main.lock.MySQLJDBCLock
  103
+karaf.lock.jdbc.url=jdbc:mysql://127.0.0.1:3306/dbname
  104
+karaf.lock.jdbc.driver=com.mysql.jdbc.Driver
  105
+karaf.lock.jdbc.user=user
  106
+karaf.lock.jdbc.password=password
  107
+karaf.lock.jdbc.table=KARAF_LOCK
  108
+karaf.lock.jdbc.clustername=karaf
  109
+karaf.lock.jdbc.timeout=30
  110
+{noformat}
  111
+
  112
+h3. PostgreSQL
  113
+
  114
+Make sure you have the PostgreSQL driver jar file in the Karaf {{lib}} folder before starting Karaf.
  115
+
  116
+*NOTE*: for 2.2.x, 2.3.x, 3.0.x you need to rename the PostgreSQL Driver jar to prefix with 'karaf-' in order for karaf to pick it up, otherwise you will see karaf just hang on startup and the log will show you that it could not find the driver.
  117
+
  118
+Then make you update the properties in {{$KARAF_HOME/etc/system.properties}} to look something like this example:
  119
+
  120
+{noformat}
  121
+karaf.lock=true
  122
+karaf.lock.class=org.apache.karaf.main.lock.PostgreSQLJDBCLock
  123
+karaf.lock.jdbc.url=jdbc:postgresql://127.0.0.1:1527/dbname
  124
+karaf.lock.jdbc.driver=org.postgresql.Driver
  125
+karaf.lock.jdbc.user=user
  126
+karaf.lock.jdbc.password=password
  127
+karaf.lock.jdbc.table=KARAF_LOCK
  128
+karaf.lock.jdbc.clustername=karaf
  129
+karaf.lock.jdbc.timeout=0
  130
+{noformat}
85 131
 
86 132
 
87 133
 {anchor:locklevel}

No commit comments for this range

Something went wrong with that request. Please try again.