You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Donald Woods <dw...@apache.org> on 2010/06/22 16:05:11 UTC
Re: svn commit: r956705 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
I don't see any comments in the code that say this resource should be
loaded/overridden by subclasses.... Is that your point, that subclasses
can override which "sql-error-state-codes.xml" is loaded, but not
"sql-keywords.rsrc" at line 4580?
-Donald
On 6/21/10 8:10 PM, Pinaki Poddar wrote:
>
> not a correct change. See code comments.
>
> -----
> Pinaki
Re: svn commit: r956705 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Posted by Donald Woods <dw...@apache.org>.
OK, rolled back change in r956959. Thanks for reviewing.
BTW - We have a ton of FindBugs hits (well over 1000), so I'm only going
after the critical/scary ones (as categorized by findbugs.)
-Donald
On 6/22/10 10:52 AM, Pinaki Poddar wrote:
>
> @@ -4621,7 +4621,7 @@ public class DBDictionary
> // initialize the error codes
> SQLErrorCodeReader codeReader = new SQLErrorCodeReader();
> String rsrc = "sql-error-state-codes.xml";
> - InputStream stream = getClass().getResourceAsStream(rsrc);
> + InputStream stream = DBDictionary.class.getResourceAsStream(rsrc);
> String dictionaryClassName = getClass().getName();
> if (stream == null) { // User supplied dictionary but no error
> codes xml
> // use default
>
>
> It is likely that a user-defined database dictionary (which is not an
> extension but a new database type or somethiig) will carry its own error
> code. So first attempt to load that resource (sql-error-state-codes.xml), if
> none present, then load the default resource that is pre-packaged with
> OpenJPA libarray relative to DBDictionary.class.
>
> -----
> Pinaki
Re: svn commit: r956705 -
/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Posted by Pinaki Poddar <pp...@apache.org>.
@@ -4621,7 +4621,7 @@ public class DBDictionary
// initialize the error codes
SQLErrorCodeReader codeReader = new SQLErrorCodeReader();
String rsrc = "sql-error-state-codes.xml";
- InputStream stream = getClass().getResourceAsStream(rsrc);
+ InputStream stream = DBDictionary.class.getResourceAsStream(rsrc);
String dictionaryClassName = getClass().getName();
if (stream == null) { // User supplied dictionary but no error
codes xml
// use default
It is likely that a user-defined database dictionary (which is not an
extension but a new database type or somethiig) will carry its own error
code. So first attempt to load that resource (sql-error-state-codes.xml), if
none present, then load the default resource that is pre-packaged with
OpenJPA libarray relative to DBDictionary.class.
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Re-svn-commit-r956705-openjpa-trunk-openjpa-jdbc-src-main-java-org-apache-openjpa-jdbc-sql-DBDictiona-tp5209003p5209144.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.