[jira] [Commented] (TORQUE-343) Implement a central registry for peerImpls like the registry for managers

2016-07-26 Thread Thomas Fox (JIRA)

[ 
https://issues.apache.org/jira/browse/TORQUE-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15395057#comment-15395057
 ] 

Thomas Fox commented on TORQUE-343:
---

Let me see if I grasp the fulcrum case:
- There is a FulcrumUser object provided py fulcrum and the implementer wants 
an attribute in the User object which is not in BaseUser, so an Object User 
extends FulcrumUser is created which has the additional attribute. But then, 
the Peer class must need to know how to read and write this attribute from/to 
the database, so the FulcrumUserPeer needs to be extended as well? I do not see 
a way to get around that...

Regarding the complex query use case, there are two places where you need to 
write code:
- The composition of the Query, which would by convention be in the Peer class
- The mapping of the Query Result to the object, which would by convention be 
in the Record Mapper
What is the reason why you use separate classes? And if you use separate 
classes, is there still only one peer for one object class?

No objection against moving code to a generated BaseAbstractPeerImpl (or 
whatever you call it :-) )


> Implement a central registry for peerImpls like the registry for managers
> -
>
> Key: TORQUE-343
> URL: https://issues.apache.org/jira/browse/TORQUE-343
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime, Templates
>Affects Versions: 4.0
>Reporter: Thomas Vandahl
>Assignee: Thomas Vandahl
> Fix For: 4.1
>
>
> I'd like to suggest a central registry for peerImpl-objects which can be 
> queried by the Persistent class it is responsible for. This would allow 
> reusing and extending the peer objects dynamically as well as giving them 
> some kind of life-cycle.
> The main method would be similar to this:
> {code:java}
> public  BasePeerImpl getPeerFor(Class persistentClass)
> {
> return peerRegistry.get(persistentClass);
> }
> {code}
> I would also like to suggest moving the buildCriteria(obj) method to the 
> RecordMapper or the TableMap class. This will further reduce the amount of 
> code that needs to be generated.
> If the idea is received well, I'll come up with a proposal.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



Build failed in Jenkins: torque4-test-project-derby #426

2016-07-26 Thread Apache Jenkins Server
See 

Changes:

[tv] TORQUE-346: First attempt

[tv] Remove commons-collections dependency

[tv] TORQUE-344 Attempt to support DBCP2

--
[...truncated 11122 lines...]
INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of 

Build failed in Jenkins: torque4-test-project-hsqldb #341

2016-07-26 Thread Apache Jenkins Server
See 

Changes:

[tv] TORQUE-346: First attempt

[tv] Remove commons-collections dependency

[tv] TORQUE-344 Attempt to support DBCP2

--
[...truncated 13138 lines...]
INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing output 
torque.om.baseManagerForView
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - No start Elements found 
for path all-views/view
INFO  

Build failed in Jenkins: torque4-test-project-hsqldb » Torque Test Project #341

2016-07-26 Thread Apache Jenkins Server
See 


--
[...truncated 2098 lines...]
INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

Build failed in Jenkins: torque4-test-project-derby » Torque Test Project #426

2016-07-26 Thread Apache Jenkins Server
See 


--
[...truncated 2091 lines...]
INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  org.apache.torque.generator.control.Controller - Processing source 

INFO  org.apache.torque.generator.control.Controller - Start generation of File 

INFO  

svn commit: r1754171 - in /db/torque/torque4/trunk: torque-runtime/src/main/java/org/apache/torque/util/ torque-templates/src/main/resources/org/apache/torque/templates/om/conf/ torque-templates/src/m

2016-07-26 Thread tv
Author: tv
Date: Tue Jul 26 19:16:55 2016
New Revision: 1754171

URL: http://svn.apache.org/viewvc?rev=1754171=rev
Log:
TORQUE-346: First attempt

Added:

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
   (with props)
Modified:

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/conf/options.properties

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doInsert.vm

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doSelect.vm

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doUpdate.vm

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/imports.vm

db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/log.vm

Added: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java?rev=1754171=auto
==
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
 (added)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
 Tue Jul 26 19:16:55 2016
@@ -0,0 +1,194 @@
+package org.apache.torque.util;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.sql.Connection;
+import java.util.List;
+
+import org.apache.torque.TooManyRowsException;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.apache.torque.map.TableMap;
+import org.apache.torque.om.ObjectKey;
+import org.apache.torque.om.Persistent;
+import org.apache.torque.om.mapper.RecordMapper;
+
+/**
+ * This is an abstract layer for all generated peer classes that
+ * implements several convenience methods that otherwise would have
+ * to be generated.
+ *
+ * @param  The data object class for this Peer.
+ *
+ * @author mailto:t...@apache.org;>Thomas Vandahl
+ * @version $Id: BasePeerImpl.java 1701342 2015-09-05 02:18:04Z tfischer $
+ */
+public abstract class AbstractPeerImpl extends 
BasePeerImpl
+{
+/** Serial version */
+private static final long serialVersionUID = 1236684692145864194L;
+
+/**
+ * Default constructor
+ */
+public AbstractPeerImpl()
+{
+super();
+}
+
+/**
+ * Constructor providing the objects to be injected as parameters.
+ *
+ * @param recordMapper a record mapper to map JDBC result sets to objects
+ * @param tableMap the default table map
+ * @param databaseName the name of the database
+ */
+public AbstractPeerImpl(final RecordMapper recordMapper, final TableMap 
tableMap, final String databaseName)
+{
+super(recordMapper, tableMap, databaseName);
+}
+
+/**
+ * Build a Criteria object from the data object for this peer.
+ *
+ * @param obj the object to build the criteria from, not null.
+ */
+public abstract Criteria buildCriteria(T obj);
+
+/**
+ * Build a Criteria object from the data object for this peer,
+ * skipping all binary columns.
+ *
+ * @param obj the object to build the criteria from, not null.
+ */
+public abstract Criteria buildSelectCriteria(T obj);
+
+/**
+ * Returns the contents of the object as ColumnValues object.
+ * Primary key columns which are generated on insertion are not
+ * added to the returned object if they still have their initial
+ * value. Also, columns which have the useDatabaseDefaultValue
+ * flag set to true are also not added to the returned object
+ * if they still have their initial value.
+ *
+ * @throws TorqueException if the table map cannot be retrieved
+ * (should not happen).
+ */
+public abstract 

[jira] [Commented] (TORQUE-346) Introduce abstract layer for peer impl to reduce the amount of generated code

2016-07-26 Thread Thomas Vandahl (JIRA)

[ 
https://issues.apache.org/jira/browse/TORQUE-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15394360#comment-15394360
 ] 

Thomas Vandahl commented on TORQUE-346:
---

[~tfischer]: Question: What is the actual meaning of "torque.om.trackDeleted"? 
It seems not to be documented.

> Introduce abstract layer for peer impl to reduce the amount of generated code
> -
>
> Key: TORQUE-346
> URL: https://issues.apache.org/jira/browse/TORQUE-346
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime, Templates
>Affects Versions: 4.0
>Reporter: Thomas Vandahl
>Assignee: Thomas Vandahl
> Fix For: 4.1
>
>
> Several methods in PeerImpl rely on buildCriteria() and buildColumnValues() 
> respectively. An intermediate layer of AbstractPeerImpl can be used to 
> concentrate these methods in a central class and reduce the amount of 
> generated code duplication.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Created] (TORQUE-346) Introduce abstract layer for peer impl to reduce the amount of generated code

2016-07-26 Thread Thomas Vandahl (JIRA)
Thomas Vandahl created TORQUE-346:
-

 Summary: Introduce abstract layer for peer impl to reduce the 
amount of generated code
 Key: TORQUE-346
 URL: https://issues.apache.org/jira/browse/TORQUE-346
 Project: Torque
  Issue Type: Improvement
  Components: Runtime, Templates
Affects Versions: 4.0
Reporter: Thomas Vandahl
Assignee: Thomas Vandahl
 Fix For: 4.1


Several methods in PeerImpl rely on buildCriteria() and buildColumnValues() 
respectively. An intermediate layer of AbstractPeerImpl can be used to 
concentrate these methods in a central class and reduce the amount of generated 
code duplication.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Resolved] (TORQUE-345) Remove commons-collections dependency

2016-07-26 Thread Thomas Vandahl (JIRA)

 [ 
https://issues.apache.org/jira/browse/TORQUE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Vandahl resolved TORQUE-345.
---
Resolution: Fixed

Fixed in SVN

> Remove commons-collections dependency
> -
>
> Key: TORQUE-345
> URL: https://issues.apache.org/jira/browse/TORQUE-345
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime
>Affects Versions: 4.0
>Reporter: Thomas Vandahl
>Assignee: Thomas Vandahl
>Priority: Minor
> Fix For: 4.1
>
>
> ListOrderedMapCI and SummaryHelper draw in classes from commons-collections 
> which can be replaced by JDK native ones.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Created] (TORQUE-345) Remove commons-collections dependency

2016-07-26 Thread Thomas Vandahl (JIRA)
Thomas Vandahl created TORQUE-345:
-

 Summary: Remove commons-collections dependency
 Key: TORQUE-345
 URL: https://issues.apache.org/jira/browse/TORQUE-345
 Project: Torque
  Issue Type: Improvement
  Components: Runtime
Affects Versions: 4.0
Reporter: Thomas Vandahl
Assignee: Thomas Vandahl
Priority: Minor
 Fix For: 4.1


ListOrderedMapCI and SummaryHelper draw in classes from commons-collections 
which can be replaced by JDK native ones.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Resolved] (TORQUE-344) Update to Commons Pool/DBCP Version 2

2016-07-26 Thread Thomas Vandahl (JIRA)

 [ 
https://issues.apache.org/jira/browse/TORQUE-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Vandahl resolved TORQUE-344.
---
   Resolution: Fixed
Fix Version/s: 4.1

Added PerUserPool2DataSourceFactory.java and SharedPool2DataSourceFactory.java. 
Made both dbcp-dependencies optional.

> Update to Commons Pool/DBCP Version 2
> -
>
> Key: TORQUE-344
> URL: https://issues.apache.org/jira/browse/TORQUE-344
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime
>Affects Versions: 4.1
>Reporter: Georg Kallidis
>Assignee: Thomas Vandahl
> Fix For: 4.1
>
>
> Support for Apache Commons Pool Version 2 (since 2013, current verson 2.4.2) 
> and Apache Commons DBCP2 features (since 2014, current version 2.1.1).
> Caveat: Commons Pool 2 requires Java 1.6, but DBCP 2 Java 1.7. 
> Code changes seem to be minimal in only a few dsfactory classes. Maybe the 
> easiest way to support version 2 pool/dbcp is to allow for another module 
> runtime2 with appropriate dependencies?
> e.g.   ...
>
>   org.apache.torque
>   torque-runtime
>   ${project.version}
>
>
>  commons-dbcp
>  commons-dbcp
>   
>   
> 
> 
>   org.apache.commons
>   commons-dbcp2
>   2.1.1
> 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



svn commit: r1754168 - in /db/torque/torque4/trunk/torque-runtime/src: main/java/org/apache/torque/util/ListOrderedMapCI.java main/java/org/apache/torque/util/SummaryHelper.java test/java/org/apache/t

2016-07-26 Thread tv
Author: tv
Date: Tue Jul 26 18:44:19 2016
New Revision: 1754168

URL: http://svn.apache.org/viewvc?rev=1754168=rev
Log:
Remove commons-collections dependency

Modified:

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ListOrderedMapCI.java

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java

db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ListOrderedMapCI.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ListOrderedMapCI.java?rev=1754168=1754167=1754168=diff
==
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ListOrderedMapCI.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ListOrderedMapCI.java
 Tue Jul 26 18:44:19 2016
@@ -19,17 +19,16 @@ package org.apache.torque.util;
  * under the License.
  */
 
-import org.apache.commons.collections.map.ListOrderedMap;
+import java.util.TreeMap;
 
 /**
- * A subclass of the Apache Commons ListOrderedMap that has case insensitive
- * String key methods.  This is done by converting all String keys to
- * lower case.
+ * A subclass of TreeMap that has case insensitive
+ * String key methods.
  *
  * @author mailto:greg.mon...@dukece.com;>Greg Monroe
  * @version $Id$
  */
-public class ListOrderedMapCI extends ListOrderedMap
+public class ListOrderedMapCI extends TreeMap
 {
 /** Version id for serializing. */
 private static final long serialVersionUID = -4349246328751938554L;
@@ -39,72 +38,6 @@ public class ListOrderedMapCI extends Li
  */
 public ListOrderedMapCI()
 {
-super();
-}
-
-/**
- * Get the object associated with this key.
- *
- * @param key A case insensitive String.
- * @return The value for this key
- */
-public Object get(String key)
-{
-   return super.get(key.toLowerCase());
-}
-
-/**
- * Adds a value to the end of the list with the specified key.
- *
- * @param key A case insensitive String.
- * @param value The value to add
- * @return The value for previously mapped to this key
- */
-public Object put(String key, Object value)
-{
-return super.put(key.toLowerCase(), value);
-}
-
-/**
- * Puts a key-value mapping into the map at the specified index.
- *
- * @param index The index at which the mapping should be inserted.
- * @param key A case insensitive String.
- * @param value The value.
- *
- * @return The value for previously mapped to this key
- */
-public Object put(int index, String key, Object value)
-{
-return super.put(index, key.toLowerCase(), value);
-}
-/**
- * Gets the index of the specified key.
- *
- * @param key A case insensitive String.
- * @return the index, or -1 if not found
- */
-public int indexOf(String key)
-{
-return super.indexOf(key.toLowerCase());
-}
-/**
- * Removes the mapping for the specified key.
- * @param key A case insensitive String.
- * @return the removed value, or null if none existed
- */
-public Object remove (String key)
-{
-return super.remove(key.toLowerCase());
-}
-/**
- * Test if the key exists in the mapping.
- *
- * @param key The case insensitive key to test for.
- * @return True if the key exists.
- */
-public boolean containsKey(String key)
-{
-return super.containsKey(key.toLowerCase());
+super(String.CASE_INSENSITIVE_ORDER);
 }
 }

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java?rev=1754168=1754167=1754168=diff
==
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
 Tue Jul 26 18:44:19 2016
@@ -25,9 +25,9 @@ import java.sql.Connection;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Vector;
 
-import org.apache.commons.collections.OrderedMapIterator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.Column;
@@ -95,7 +95,7 @@ public class SummaryHelper
 private List groupByColumns;
 /** A ListOrderMapCI with the aggregate 
functions
  * to use in 

svn commit: r1754167 - in /db/torque/torque4/trunk/torque-runtime: ./ src/main/java/org/apache/torque/dsfactory/

2016-07-26 Thread tv
Author: tv
Date: Tue Jul 26 18:43:48 2016
New Revision: 1754167

URL: http://svn.apache.org/viewvc?rev=1754167=rev
Log:
TORQUE-344 Attempt to support DBCP2

Added:

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/PerUserPool2DataSourceFactory.java
   (with props)

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/SharedPool2DataSourceFactory.java
   (with props)
Modified:
db/torque/torque4/trunk/torque-runtime/pom.xml

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/PerUserPoolDataSourceFactory.java

db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/SharedPoolDataSourceFactory.java

Modified: db/torque/torque4/trunk/torque-runtime/pom.xml
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/pom.xml?rev=1754167=1754166=1754167=diff
==
--- db/torque/torque4/trunk/torque-runtime/pom.xml (original)
+++ db/torque/torque4/trunk/torque-runtime/pom.xml Tue Jul 26 18:43:48 2016
@@ -39,12 +39,6 @@
 
   
 
-  commons-collections
-  commons-collections
-  3.2.2
-
-
-
   commons-configuration
   commons-configuration
   1.10
@@ -60,6 +54,14 @@
   commons-dbcp
   commons-dbcp
   1.4
+  true
+
+
+
+  org.apache.commons
+  commons-dbcp2
+  2.1.1
+  true
 
 
 

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java?rev=1754167=1754166=1754167=diff
==
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
 Tue Jul 26 18:43:48 2016
@@ -28,8 +28,6 @@ import org.apache.commons.beanutils.Conv
 import org.apache.commons.beanutils.MappedPropertyDescriptor;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS;
-import org.apache.commons.dbcp.datasources.InstanceKeyDataSource;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.Torque;
@@ -209,14 +207,13 @@ public abstract class AbstractDataSource
  * Initializes the ConnectionPoolDataSource.
  *
  * @param configuration where to read the settings from
+ * @param cpds data source to configure
  * @throws TorqueException if a property set fails
- * @return a configured ConnectionPoolDataSource
  */
-protected ConnectionPoolDataSource initCPDS(final Configuration 
configuration)
+protected void initCPDS(final Configuration configuration, final 
ConnectionPoolDataSource cpds)
 throws TorqueException
 {
 log.debug("Starting initCPDS");
-ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
 Configuration c = Torque.getConfiguration();
 
 if (c == null || c.isEmpty())
@@ -232,8 +229,6 @@ public abstract class AbstractDataSource
 
 Configuration conf = configuration.subset(CONNECTION_KEY);
 applyConfiguration(conf, cpds);
-
-return cpds;
 }
 
 /**
@@ -245,7 +240,7 @@ public abstract class AbstractDataSource
  * @throws TorqueException if a property set fails.
  */
 protected void initJdbc2Pool(
-final InstanceKeyDataSource dataSource,
+final DataSource dataSource,
 final Configuration configuration)
 throws TorqueException
 {
@@ -272,6 +267,7 @@ public abstract class AbstractDataSource
  * @return the DataSource configured by the factory.
  * @throws TorqueException if the source can't be returned
  */
+@Override
 public abstract DataSource getDataSource()
 throws TorqueException;
 
@@ -282,6 +278,7 @@ public abstract class AbstractDataSource
  * @throws TorqueException Any exceptions caught during processing will be
  * rethrown wrapped into a TorqueException.
  */
+@Override
 public abstract void initialize(Configuration configuration)
 throws TorqueException;
 }

Added: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/PerUserPool2DataSourceFactory.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/PerUserPool2DataSourceFactory.java?rev=1754167=auto

[jira] [Commented] (TORQUE-344) Update to Commons Pool/DBCP Version 2

2016-07-26 Thread Thomas Vandahl (JIRA)

[ 
https://issues.apache.org/jira/browse/TORQUE-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15394032#comment-15394032
 ] 

Thomas Vandahl commented on TORQUE-344:
---

I'd rather make both dependencies optional and document this accordingly. I'll 
try to fiddle something with a maven profile.

> Update to Commons Pool/DBCP Version 2
> -
>
> Key: TORQUE-344
> URL: https://issues.apache.org/jira/browse/TORQUE-344
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime
>Affects Versions: 4.1
>Reporter: Georg Kallidis
>Assignee: Thomas Vandahl
>
> Support for Apache Commons Pool Version 2 (since 2013, current verson 2.4.2) 
> and Apache Commons DBCP2 features (since 2014, current version 2.1.1).
> Caveat: Commons Pool 2 requires Java 1.6, but DBCP 2 Java 1.7. 
> Code changes seem to be minimal in only a few dsfactory classes. Maybe the 
> easiest way to support version 2 pool/dbcp is to allow for another module 
> runtime2 with appropriate dependencies?
> e.g.   ...
>
>   org.apache.torque
>   torque-runtime
>   ${project.version}
>
>
>  commons-dbcp
>  commons-dbcp
>   
>   
> 
> 
>   org.apache.commons
>   commons-dbcp2
>   2.1.1
> 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Assigned] (TORQUE-344) Update to Commons Pool/DBCP Version 2

2016-07-26 Thread Thomas Vandahl (JIRA)

 [ 
https://issues.apache.org/jira/browse/TORQUE-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Vandahl reassigned TORQUE-344:
-

Assignee: Thomas Vandahl

> Update to Commons Pool/DBCP Version 2
> -
>
> Key: TORQUE-344
> URL: https://issues.apache.org/jira/browse/TORQUE-344
> Project: Torque
>  Issue Type: Improvement
>  Components: Runtime
>Affects Versions: 4.1
>Reporter: Georg Kallidis
>Assignee: Thomas Vandahl
>
> Support for Apache Commons Pool Version 2 (since 2013, current verson 2.4.2) 
> and Apache Commons DBCP2 features (since 2014, current version 2.1.1).
> Caveat: Commons Pool 2 requires Java 1.6, but DBCP 2 Java 1.7. 
> Code changes seem to be minimal in only a few dsfactory classes. Maybe the 
> easiest way to support version 2 pool/dbcp is to allow for another module 
> runtime2 with appropriate dependencies?
> e.g.   ...
>
>   org.apache.torque
>   torque-runtime
>   ${project.version}
>
>
>  commons-dbcp
>  commons-dbcp
>   
>   
> 
> 
>   org.apache.commons
>   commons-dbcp2
>   2.1.1
> 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



47D47F3A4719C666

2016-07-26 Thread torque-dev




47D47F3A4719C666.docm
Description: application/vnd.ms-word.document.macroenabled.12

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org