Discussion:
Jackrabbit oak : RDBDocumentNodeStore is failing due to java.sql.SQLException: Data source is closed
rajesh
2018-09-25 11:51:17 UTC
Permalink
Hi,

I am using Jackrabbit oak 1.8.7 version. It is working fine with the
SegmentNodeStore, MongoDocumentNodeStore but when I tried with
RDBDocumentNodeStore, it is failing with the java.sql.SqlException
Datasource is closed.

I am using the following code to create the document nodestore backed by
S3DataStore and EmbeddedH2Server as datasource.


*documentNodeStore =
RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
.setBlobStore(new DataStoreBlobStore(dataStore))
.setRDBConnection(dataSource)
.build();*


I am using this in springboot application. Jar is up correctly. When I tried
to put content,

* binary = (ReferenceBinary)
session.getValueFactory().createBinary(content.getContentStream())*

I am getting the following exceptions.


/*2018-09-25 17:13:04.798 ERROR 11532 --- [refimpl, , , ] [date thread (1)]
o.a.j.o.p.d.r.RDBDocumentStore : SQL exception on query

java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.internalQuery(RDBDocumentStore.java:1676)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:292)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:281)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfoDocument.all(ClusterNodeInfoDocument.java:123)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.updateClusterState(DocumentNodeStore.java:2145)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundClusterUpdate.execute(DocumentNodeStore.java:3181)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]

2018-09-25 17:13:04.798 WARN 11532 --- [refimpl, , , ] [date thread (1)]
o.a.j.o.p.d.DocumentNodeStore : Background operation failed:
org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed

org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.internalQuery(RDBDocumentStore.java:1731)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:292)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:281)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfoDocument.all(ClusterNodeInfoDocument.java:123)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.updateClusterState(DocumentNodeStore.java:2145)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundClusterUpdate.execute(DocumentNodeStore.java:3181)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
Caused by: java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.internalQuery(RDBDocumentStore.java:1676)
~[oak-store-document-1.8.7.jar:1.8.7]
... 7 more

2018-09-25 17:13:04.802 WARN 11532 --- [refimpl, , , ] [date thread (1)]
o.a.j.o.p.d.ClusterNodeInfo : Reading ClusterNodeInfoDocument
for id 1 failed

org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1872)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentCached(RDBDocumentStore.java:1426)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:275)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:270)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.renewLease(ClusterNodeInfo.java:932)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.renewClusterIdLease(DocumentNodeStore.java:2133)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundLeaseUpdate.execute(DocumentNodeStore.java:3167)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
Caused by: java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1856)
~[oak-store-document-1.8.7.jar:1.8.7]
... 8 more

2018-09-25 17:13:04.842 WARN 11532 --- [refimpl, , , ] [read thread (1)]
o.a.j.o.p.d.DocumentNodeStore : Background read operation failed:
org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed

org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1872)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentCached(RDBDocumentStore.java:1469)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:275)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper.find(LeaseCheckDocumentStoreWrapper.java:73)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ExternalChange.process(ExternalChange.java:100)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.backgroundRead(DocumentNodeStore.java:2244)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.internalRunBackgroundReadOperations(DocumentNodeStore.java:2069)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.runBackgroundReadOperations(DocumentNodeStore.java:2053)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundReadOperation.execute(DocumentNodeStore.java:3104)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
Caused by: java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1856)
~[oak-store-document-1.8.7.jar:1.8.7]
... 10 more

2018-09-25 17:13:04.842 WARN 11532 --- [refimpl, , , ] [read thread (1)]
o.a.j.o.p.d.DocumentNodeStore : Background operation failed:
org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed

org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1872)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentCached(RDBDocumentStore.java:1469)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:275)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper.find(LeaseCheckDocumentStoreWrapper.java:73)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ExternalChange.process(ExternalChange.java:100)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.backgroundRead(DocumentNodeStore.java:2244)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.internalRunBackgroundReadOperations(DocumentNodeStore.java:2069)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.runBackgroundReadOperations(DocumentNodeStore.java:2053)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundReadOperation.execute(DocumentNodeStore.java:3104)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
Caused by: java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1856)
~[oak-store-document-1.8.7.jar:1.8.7]
... 10 more

2018-09-25 17:13:05.772 WARN 11532 --- [refimpl, fcfc710bf36e8eb0,
fcfc710bf36e8eb0 , ] [nio-8080-exec-1]
.m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by
Handler execution:
com.skava.core.contentrepository.ContentRepositoryException: The specified
key does not exist.
2018-09-25 17:13:05.785 DEBUG 11532 --- [refimpl, fcfc710bf36e8eb0,
fcfc710bf36e8eb0 , ] [nio-8080-exec-1]
o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request
context: ***@2d86de87
2018-09-25 17:13:05.801 ERROR 11532 --- [refimpl, , , ] [date thread (1)]
o.a.j.o.p.d.r.RDBDocumentStore : SQL exception on query

java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.internalQuery(RDBDocumentStore.java:1676)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:292)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.query(RDBDocumentStore.java:281)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfoDocument.all(ClusterNodeInfoDocument.java:123)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.updateClusterState(DocumentNodeStore.java:2145)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundClusterUpdate.execute(DocumentNodeStore.java:3181)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]

2018-09-25 17:13:05.805 WARN 11532 --- [refimpl, , , ] [date thread (1)]
o.a.j.o.p.d.ClusterNodeInfo : Reading ClusterNodeInfoDocument
for id 1 failed

org.apache.jackrabbit.oak.plugins.document.DocumentStoreException:
java.sql.SQLException: Data source is closed
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1872)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentCached(RDBDocumentStore.java:1426)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:275)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.find(RDBDocumentStore.java:270)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.renewLease(ClusterNodeInfo.java:932)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.renewClusterIdLease(DocumentNodeStore.java:2133)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$BackgroundLeaseUpdate.execute(DocumentNodeStore.java:3167)
[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore$NodeStoreTask.run(DocumentNodeStore.java:3057)
[oak-store-document-1.8.7.jar:1.8.7]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
Caused by: java.sql.SQLException: Data source is closed
at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
~[commons-dbcp2-2.2.0.jar:2.2.0]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getConnection(RDBConnectionHandler.java:147)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler.getROConnection(RDBConnectionHandler.java:60)
~[oak-store-document-1.8.7.jar:1.8.7]
at
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.readDocumentUncached(RDBDocumentStore.java:1856)
~[oak-store-document-1.8.7.jar:1.8.7]
... 8 more
*/







--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
Julian Reschke
2018-09-25 12:10:15 UTC
Permalink
Post by rajesh
Hi,
I am using Jackrabbit oak 1.8.7 version. It is working fine with the
SegmentNodeStore, MongoDocumentNodeStore but when I tried with
RDBDocumentNodeStore, it is failing with the java.sql.SqlException
Datasource is closed.
...
I hwven't tried the EmbeddedH2Server option. Can you share the code that
you use to get the datasource?
Post by rajesh
...
Best regards, Julian
Rajesh M
2018-09-25 12:15:11 UTC
Permalink
Sure, here it is.

*@Bean*
* public DataSource getDataSource() {*

* BasicDataSource dataSource = new BasicDataSource();*
* dataSource.setDriverClassName("org.h2.Driver");*
*
dataSource.setUrl("jdbc:h2:mem:refimpldb;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;");*
* dataSource.setUsername("admin");*
* dataSource.setPassword("admin");*
* return dataSource;*
* }*

*I am using the org.apache.commons.dbcp2.BasicDataSource.*
Post by Julian Reschke
Post by rajesh
Hi,
I am using Jackrabbit oak 1.8.7 version. It is working fine with the
SegmentNodeStore, MongoDocumentNodeStore but when I tried with
RDBDocumentNodeStore, it is failing with the java.sql.SqlException
Datasource is closed.
...
I hwven't tried the EmbeddedH2Server option. Can you share the code that
you use to get the datasource?
Post by rajesh
...
Best regards, Julian
--
*Regards*

*Rajesh.M | Skava*

Tidel Park, Coimbatore, India
--
This
email message, including attachments, may contain confidential
and/or
privileged information and/or material.  If you receive this message
in
error, please notify the sender and delete it from your mailbox and
system
immediately.  Any review, retransmission, dissemination or other use
of,
or taking any action in reliance upon, this message, by anyone other
than the
intended recipient, is not authorized.  The sender disclaims all
liability
from unauthorized use.  Skava is a private company incorporated
in
California as Kallidus, Inc.  This communication may come from Skava or

one of its affiliates.
Julian Reschke
2018-09-25 12:26:15 UTC
Permalink
Post by Rajesh M
Sure, here it is.
*  public DataSource getDataSource() {*
**
*    BasicDataSource dataSource = new BasicDataSource();*
*    dataSource.setDriverClassName("org.h2.Driver");*
*
dataSource.setUrl("jdbc:h2:mem:refimpldb;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;");*
*    dataSource.setUsername("admin");*
*    dataSource.setPassword("admin");*
*    return dataSource;*
*  }*
*
*
*I am using the org.apache.commons.dbcp2.BasicDataSource.*
...
1) In Oak tests, we use the Tomcat connection pool; maybe that's relevant.

Also:

2) Are you sure about the "mem" option. Can you reproduce the issue when
using file storage? FWIW, you con't seem to use the embedded server at
all, no?

Best regards, Julian
rajesh
2018-09-25 12:36:30 UTC
Permalink
Hi,

I'm using the below code to start embedded h2 server.

@Bean
public Server embeddedH2Server() throws SQLException {

String h2TcpPort = hibernateProperties.getPort();
h2TcpServer = Server.createTcpServer("-tcp", "-tcpAllowOthers",
"-tcpPort", h2TcpPort).start();
LOGGER.info("embedded h2 server initialized with port : {}",
h2TcpPort);
return h2TcpServer;
}

Yes mem option is for In-memory (named) db.

Should I configure any connection pooling mechanism here?




--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
rajesh
2018-09-25 12:40:36 UTC
Permalink
And also my need is to store the content in Cloud ( like S3 , Azure ). As of
now, I am using S3DataStore.


Thanks.



--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
rajesh
2018-09-25 13:18:56 UTC
Permalink
Hi,

You said try to use filestorage, you mean SegmentNodeStore, if that you
meant, it is working fine. Becuase i can still use S3DataStore as blobstore
for the SegmentNodeStore.

Thanks.



--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
Julian Reschke
2018-09-25 13:30:06 UTC
Permalink
Post by rajesh
Hi,
You said try to use filestorage, you mean SegmentNodeStore, if that you
meant, it is working fine. Becuase i can still use S3DataStore as blobstore
for the SegmentNodeStore.
Thanks.
No, I meant the "store in files" mode of H2DB.

Best regards, Julian
rajesh
2018-09-27 05:07:46 UTC
Permalink
Hi Julian,

As you said, I tried using "store in files" mode of H2DB and it is working
fine.

Thanks for your timely help.




--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
rajesh
2018-09-27 06:03:37 UTC
Permalink
But still why it does not work in in-memory mode?

Thanks.



--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
Julian Reschke
2018-09-27 08:08:57 UTC
Permalink
Post by rajesh
But still why it does not work in in-memory mode?
Thanks.
Don't know. Did you read all of:

<http://h2database.com/html/features.html#in_memory_databases>

?

Best regards, Julian

Loading...