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

ASF GitHub Bot commented on OPENJPA-2754:
-----------------------------------------

rmannibucau commented on issue #24: [OPENJPA-2754] maxActive -> maxTotal
URL: https://github.com/apache/openjpa/pull/24#issuecomment-438555556
 
 
   @solomax i'm not following that last statement. Let me try to explain a bit 
more my thought andlet see where we don't align:
   
   1. in DataSourceFactory you can test rawDs.getClass().getName() (there are a 
few dbcp impl) or if you prefer to tolerate children we can alwaysuse  try { 
loadClass(base).isInstance(rawDs)} catch NoClassDefFoundError | 
ClassNotFoundException ignore) {} pattern
   2. then we just have to maintain a mapping between properties and setters:
   
       private final Map<String, Map<String, String>> mappingPerClass = new 
HashMapString, Map<String, String>() {{
            put("dbcp class name", new HashMap<String, String>() {{
               put("connectionUsername", "username");
               put("driver", "driverClassName");
            }}
       }}
   
   
   etc... (feel free to directly use setter names instead of field name if more 
relevant)
   
   this way we are loosely coupled and don't require at all dbcp. The 
alternative is to make dbcp optional and have a small indirection 
"DataSourceFactoryHandler" with accept(Object instance) and map(properties)
   
   does it sounds better this way?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> update to latest dbcp and verify moving from maxActive to maxTotal
> ------------------------------------------------------------------
>
>                 Key: OPENJPA-2754
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2754
>             Project: OpenJPA
>          Issue Type: Task
>          Components: jdbc
>    Affects Versions: 3.0.0
>            Reporter: Mark Struberg
>            Priority: Major
>             Fix For: 3.0.1
>
>
> commons-dbcp 2 moved from maxActive to maxTotal 
> https://commons.apache.org/proper/commons-dbcp/
> https://commons.apache.org/proper/commons-dbcp/configuration.html
> But all across our build we still use MaxActive.
> Do we like to keep this? Do we (via reflection) don't care and users need to 
> care for themselves if they switch?
> Do we do it right in our unit tests right now?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to