[
https://issues.apache.org/jira/browse/ARTEMIS-2823?focusedWorklogId=493655&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-493655
]
ASF GitHub Bot logged work on ARTEMIS-2823:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 01/Oct/20 19:28
Start Date: 01/Oct/20 19:28
Worklog Time Spent: 10m
Work Description: ehsavoie commented on a change in pull request #3204:
URL: https://github.com/apache/activemq-artemis/pull/3204#discussion_r498467162
##########
File path:
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java
##########
@@ -56,31 +56,31 @@ public PostgresLargeObjectManager(Connection connection)
throws SQLException {
}
}
- public final Long createLO() throws SQLException {
+ public final Long createLO(Connection connection) throws SQLException {
if (shouldUseReflection) {
- Object largeObjectManager = getLargeObjectManager();
+ Object largeObjectManager = getLargeObjectManager(connection);
try {
- Method method =
largeObjectManager.getClass().getMethod("createLO");
- return (Long) method.invoke(largeObjectManager);
+ Method method =
largeObjectManager.getClass().getMethod("createLO", Connection.class);
+ return (Long) method.invoke(largeObjectManager, connection);
Review comment:
connection is not a parameter of this method
##########
File path:
artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java
##########
@@ -56,31 +56,31 @@ public PostgresLargeObjectManager(Connection connection)
throws SQLException {
}
}
- public final Long createLO() throws SQLException {
+ public final Long createLO(Connection connection) throws SQLException {
if (shouldUseReflection) {
- Object largeObjectManager = getLargeObjectManager();
+ Object largeObjectManager = getLargeObjectManager(connection);
try {
- Method method =
largeObjectManager.getClass().getMethod("createLO");
- return (Long) method.invoke(largeObjectManager);
+ Method method =
largeObjectManager.getClass().getMethod("createLO", Connection.class);
+ return (Long) method.invoke(largeObjectManager, connection);
} catch (NoSuchMethodException | SecurityException |
IllegalAccessException | IllegalArgumentException | InvocationTargetException
ex) {
throw new SQLException("Couldn't access
org.postgresql.largeobject.LargeObjectManager", ex);
}
} else {
- return ((PGConnection) realConnection).getLargeObjectAPI().createLO();
+ return ((PGConnection)
unwrap(connection)).getLargeObjectAPI().createLO();
}
}
- public Object open(long oid, int mode) throws SQLException {
+ public Object open(Connection connection, long oid, int mode) throws
SQLException {
if (shouldUseReflection) {
- Object largeObjectManager = getLargeObjectManager();
+ Object largeObjectManager = getLargeObjectManager(connection);
try {
- Method method = largeObjectManager.getClass().getMethod("open",
long.class, int.class);
- return method.invoke(largeObjectManager, oid, mode);
+ Method method = largeObjectManager.getClass().getMethod("open",
Connection.class, long.class, int.class);
+ return method.invoke(largeObjectManager, connection, oid, mode);
Review comment:
connection is not a parameter of this method
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 493655)
Time Spent: 13h 50m (was: 13h 40m)
> Improve JDBC connection management
> ----------------------------------
>
> Key: ARTEMIS-2823
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2823
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Reporter: Mikko
> Priority: Major
> Time Spent: 13h 50m
> Remaining Estimate: 0h
>
> I have a case where the whole clustering reliability and HA must rely on HA
> capabilities of clustered database, and running on top of application server
> is not an option.
> The current JDBC store implementation is rather bare bones on the connection
> management side. JDBC driver is used directly with no management layer. At
> startup, the broker just opens couple of direct connections to database and
> expects them to be available forever. This is something that cannot be
> expected in HA production environment. So, similarly to the discussion linked
> below, in our case we lose the db connection after one hour, and all the
> brokers need to be restared to get new connections:
> [http://activemq.2283324.n4.nabble.com/Artemis-does-not-reconnect-to-MySQL-after-connection-timeout-td4751956.html]
>
> This is something that could be resolved by simply using JDBC4 isValid
> checks, but proper connection handling and pooling through datasource would
> be preferrable.
> I have implemented a solution for this by using DBCP2 datasource. Our test
> cluster has been successfully running this forked version since the release
> of Artemis 2.13.0. I will prepare of pull request if this is seen to be
> something that can be useful.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)