Issue Details (XML | Word | Printable)

Key: JDO-191
Type: Test Test
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig Russell
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Add test for PersistenceManager.getDataStoreConnection()

Created: 19/Oct/05 07:07 AM   Updated: 26/Mar/06 10:34 AM
Return to search
Component/s: tck2
Affects Version/s: JDO 2 beta
Fix Version/s: JDO 2 final

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works DataStoreConnection.java 2006-03-08 03:11 AM Craig Russell 5 kB
Java Source File Licensed for inclusion in ASF works DataStoreConnection.java 2006-03-07 01:30 PM Craig Russell 3 kB
Java Source File Licensed for inclusion in ASF works DataStoreConnectionThrows.java 2006-03-08 03:11 AM Craig Russell 6 kB
Environment: TCK

Resolution Date: 09/Mar/06 07:47 AM


 Description  « Hide
A12.16-1 [JDOConnection getDataStoreConnection(); If this method is called while a datastore transaction is active, the object returned will be enlisted in the current transaction. If called in an optimistic transaction before flush has been called, or outside an active transaction, the object returned will not be enlisted in any transaction.]]

The tests use the jdbc Connection.

The test needs to work with the jdbc library from the standard JDK 1.3 (JDBC 2.0).

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 07/Mar/06 01:30 PM
Please review this patch.

Craig Russell added a comment - 08/Mar/06 03:11 AM
These test programs test the ability to get data from the JDBC Connection for implementations that support the getDataStoreConnection and SQL optional features.

Currently JPOX fails the DataStoreConnectionThrows tests because it passes the Connection object directly to the user instead of wrapping it.

Note that JPOX could add a feature to permit restricted Connection methods to be used by setting a property, e.g. org.jpox.jdoconnection.Unrestricted.

Craig Russell added a comment - 09/Mar/06 07:47 AM
svn commit -m "JDO-191 Added tests for DataStoreConnection" \
src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnection.java \
src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnectionThrows.java \
src/conf/pm.conf \
src/java/org/apache/jdo/tck/JDO_Test.java
Sending src/conf/pm.conf
Sending src/java/org/apache/jdo/tck/JDO_Test.java
Adding src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnection.java
Adding src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnectionThrows.java
Transmitting file data ....
Committed revision 384378.

Andy Jefferson added a comment - 12/Mar/06 09:31 AM
You say that JPOX fails DataStoreConnectionThrows because it passes a Connection directly instead of wrapping it. Can you please define what you mean here ? JPOX returns a org.jpox.JDOConnectionImpl from PM.getDataStoreConnection(). JDOConnectionImpl implements java.sql.Connection, and javax.jdo.datastore.JDOConnection. This does indeed wrap a (java.sql.)Connection. The test then proceeds to call commit not on the JDOConnection but on the native connection that it wraps. Are we saying that getNativeConnection() has to return the wrapped connection ? The spec says nothing about the returned object from getNativeConnection() wrapping a connection. Can we have a clarification on what this test is actually checking.

Craig Russell added a comment - 13/Mar/06 03:17 AM
The test now simply casts the JDOConnectin to jdbc Connection.

Michelle Caisse added a comment - 26/Mar/06 10:34 AM
Updated Implemented to yes in spreadsheet.