when using JNDI, will try to discover the real adapter. #25

Open
wants to merge 5 commits into
from

Projects

None yet

4 participants

@patcheng

and centralize the special handling of the adapter for Sqlserver so we don't get error when using transaction.

@patcheng patcheng when using JNDI, will try to discover the real adapter.
and centralize the special handling of the adapter for Sqlserver so we don't get error when using transaction.
2e65f4c
@mkristian

cool, I like this patch: first get the real connection and infer the adapter from the JDBCDriver name of the very same connection.

patcheng added some commits Feb 22, 2012
@patcheng patcheng conn needs to be outside begin-ensure-end otherwise, conn inside ensu…
…re block would be nil
b37a48f
@patcheng patcheng When using DBCP, the Statement returned is a DBCP's DelegatingStateme…
…nt which cannot be casted as a OracleStatement.

Need to unwrap it first.
d01e45f
@patcheng patcheng broke data mapper to sqlite.
DataMapper expects Sqlite adapter, but DataObject expects Sqlite3.

There is code in dm-sqlite-adapter to change the adapter from sqlite to sqlite3, and the dm-do-adapter to create URI using adapter instead of scheme….

but that breaks JNDI case, when we want to scheme to stay 'java', but adapter to be whatever the underlying adapter is.

consolidated more of the logic that maps DM constants to DO constants

and changing DriverDefinition's verifyScheme to check for both scheme and jdbcScheme (in the case of 'sqlite' vs. 'sqlite3').
2cd6d12
@patcheng patcheng now works with Oracle JDBC driver 10.2.0.1.0.
Avoided references to OraclePreparedStatement completely. Apparently there are multiple definition of the class, and it moves around.
e5ea5f6
@myabc myabc was assigned Jun 7, 2012
@myabc
Member
myabc commented Jun 7, 2012

@patcheng @mkristian Sorry for only just following up on this patch. The JNDI part looks right.

I'm just trying to understand the Oracle JDBC driver changes. Would it be possible to have that as a separate PR? (wdyt @pietia)

@pietia
Member
pietia commented Jun 7, 2012

@myabc +1 for separate patches

@pietia
Member
pietia commented Jun 7, 2012

@patcheng your commits are really interesting! Did you check if your version still works with other Oracle drivers?

@mkristian

this is tomcat specific code. it feels like we start to handle very special cases here, like tomcat connection pool DBCP.

@mkristian
Member

I never saw the second set of patches - should have merged the JNDI commit immediately ;). the DBCP commit is very specific code - tomcat related.

@patcheng
patcheng commented Oct 6, 2012

@pietia It should. The problem is with the newer version of Oracle JDBC driver, they changed the package name of the OraclePrepareStatement, so there is no way to have a class file that works with the older and newer version.

That's why I had to do reflection.

@patcheng
patcheng commented Oct 6, 2012

@mkristian yeah, I am not happy with the DBCP-specific code either. But when running under Tomcat, I cannot find another way to get to Oracle's PrepareStatement class.

@tillsc tillsc referenced this pull request in datamapper/dm-core Dec 7, 2012
Merged

better support for JNDI URLs #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment