beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Drew Varner (JIRA)" <j...@apache.org>
Subject [jira] Updated: (BEEHIVE-1019) Allow multiple JDBC Controls to share the same database connection
Date Tue, 12 Dec 2006 03:33:21 GMT
     [ http://issues.apache.org/jira/browse/BEEHIVE-1019?page=all ]

Drew Varner updated BEEHIVE-1019:
---------------------------------

    Attachment: PATCH.txt

Patch Notes:

This patch adds a setConnection(Connection conn) method to JDBC Controls.

This method is useful for:

1) Easy unit testing setup (no need to create JNDI context just to test)..
2) Putting multiple JDBC Controls in a single database transaction
3) Integrating JDBC Controls with third party Connection factories
4) Sharing connections between JDBCControls, DAOs and plain JDBC calls

This patch changes the way JDBC Controls behave:

1) They no longer get a Connection at the onAcquire() lifecycle method
2) Connections are obtained lazily at invoke()
3) Connections are not closed if they were set by setConnection()
4) Controls can function without declaring a connection source in annotations

The following files are added/modified in this patch:

M      system-controls/test/ant/junitCore.xml
A      system-controls/test/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/setconnection
A      system-controls/test/jdbc/controls/org/apache/beehive/controls/system/jdbc/test/setconnection/NoConnectionAnnotationCtrl.jcx
A      system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection
A      system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/DBSetConnectionTest.java
A      system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/JdbcTypesTest.java
A      system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/SetConnectionTest.java
A      system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/TxResultsTest.java
M      system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControl.java
M      system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java

What you might not like about this patch:

1) I removed .jcx references in the JDBC Control Javadoc, I don't think they have to be called
.jcx.
2) The following test suites extend other test suites. I thought it was an easy way to test
functionality. I just call setConnection() in the setUp() method

system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/DBSetConnectionTest.java
system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/JdbcTypesTest.java
system-controls/test/jdbc/junitTests/org/apache/beehive/controls/system/jdbc/units/setconnection/TxResultsTest.java

The following Ant target passed:

ant clean deploy systemcontrols.drt

On OS X, Java 1.5.0_06

> Allow multiple JDBC Controls to share the same database connection
> ------------------------------------------------------------------
>
>                 Key: BEEHIVE-1019
>                 URL: http://issues.apache.org/jira/browse/BEEHIVE-1019
>             Project: Beehive
>          Issue Type: Improvement
>          Components: System Controls
>    Affects Versions: 1.0
>            Reporter: Chad Schoettger
>         Attachments: PATCH.txt
>
>
> Allow multiple JDBC controls to share a single database connection.  One benefit of this
improvment would be that multiple jdbc controls could participate in a transaction.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message