datamapper / do

DataObjects
147 stars 73 forks source link

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

Open patcheng opened 12 years ago

patcheng commented 12 years ago

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

myabc commented 12 years ago

@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 commented 12 years ago

@myabc +1 for separate patches

pietia commented 12 years ago

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

mkristian commented 12 years ago

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 commented 12 years ago

@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 commented 12 years ago

@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.