ruanwenjun commented on a change in pull request #434:
URL: 
https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670986723



##########
File path: 
eventmesh-store-h2/src/main/java/org/apache/eventmesh/store/h2/schema/util/DBDataSource.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.h2.schema.util;
+
+import org.apache.eventmesh.store.h2.schema.configuration.DBConfiguration;
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class DBDataSource {
+    private static BasicDataSource ds = null;
+
+    private DBDataSource() {
+
+    }
+
+    public static synchronized DBDataSource createDataSource(DBConfiguration 
dbConfig) {

Review comment:
       But when we execute `createDataSource` method twice, we will get two 
`DBDataSource` instances, this is confusion, I think you would better make this 
class to be a real singleton.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to