You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Fay Wang (JIRA)" <ji...@apache.org> on 2008/03/17 22:30:26 UTC

[jira] Created: (OPENJPA-538) In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported" thrown from the backend.

In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported"  thrown from the backend. 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-538
                 URL: https://issues.apache.org/jira/browse/OPENJPA-538
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.1.0
            Reporter: Fay Wang
             Fix For: 1.1.0


[jcc][t4][10205][11234][3.51.74] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815
org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4054)
org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:501)
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:80)
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:402)
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:592)
org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:464)
org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:440)
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:576)
org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:517)
org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2814)
org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-538) In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported" thrown from the backend.

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fay Wang updated OPENJPA-538:
-----------------------------

    Attachment: OPENJPA-538.637439.patch

The attached patch should resolve this problem.

> In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported"  thrown from the backend. 
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-538
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-538
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Fay Wang
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-538.637439.patch
>
>
> [jcc][t4][10205][11234][3.51.74] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815
> org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4054)
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:501)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:80)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:402)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:592)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:464)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:440)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:576)
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:517)
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2814)
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-538) In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported" thrown from the backend.

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580052#action_12580052 ] 

Fay Wang commented on OPENJPA-538:
----------------------------------

HI Kevin,
    Thanks for your comments.  I debugged through and found that JBDCConfigurationImpl.getDataSource2  will call getDataSource if getConnectionFactory2 is null. In my test case,  I use type 4 url and the ConnectionDriverName is com.ibm.db2.jcc.DB2Driver (instead of  org.apache.commons.dbcp.BasicDataSource). Also, the ConnectionFactory2 is null  in my testcase. 

    The datasource that is returned from  getDataSource2 is DecoratingDataSource. The call to DecoratingDataSource.getConnection( )  eventually leads to SimpleDriverDataSource.getConnection(null).  An SQL error therefore occurrs when type 4 url is used without user name and password. 

     Another information is if I use org.apache.commons.dbcp.BasicDataSource as ConnectionDriverName, then the test case works fine, because it is in the BasicDataSource.getConnection( ) that is invoked, instead of SimpleDriverDataSource. 

     We probably need to modify java doc to take into account  the case when SimpleDriverDataSource is used. 


> In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported"  thrown from the backend. 
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-538
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-538
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Fay Wang
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-538.637439.patch
>
>
> [jcc][t4][10205][11234][3.51.74] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815
> org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4054)
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:501)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:80)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:402)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:592)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:464)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:440)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:576)
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:517)
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2814)
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-538) In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported" thrown from the backend.

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fay Wang resolved OPENJPA-538.
------------------------------

    Resolution: Invalid

This is a test case error.

> In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported"  thrown from the backend. 
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-538
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-538
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Fay Wang
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-538.637439.patch
>
>
> [jcc][t4][10205][11234][3.51.74] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815
> org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4054)
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:501)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:80)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:402)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:592)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:464)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:440)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:576)
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:517)
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2814)
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-538) In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported" thrown from the backend.

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579699#action_12579699 ] 

Kevin Sutter commented on OPENJPA-538:
--------------------------------------

Fay,
Although the attached patch probably resolves the problem, the code is not consistent with the javadoc.  According to the javadoc, the call to getDataSource2 should resolve to the right username and password.  If that's not working as expected, then we should fix that problem.  Here's the javadoc for getDataSource2:

DataSource org.apache.openjpa.jdbc.conf.JDBCConfiguration.getDataSource2(StoreContext ctx)
Return the non-enlisted data source to use. If there is a valid non-xa connection factory configured, then it will be returned. Its default user name and password on calls to DataSource.getConnection will be the specificed connection 2 user name and password. If those are null and the given context is non-null, its user name password will be used instead. If the context is null too, then the user name and password used to retrieve the first context will be used. If there is no second connection factory the primary connection factory is used. 

Thanks,
Kevin

> In the case when user id and password are provided, openjpa should use them in the call to getConnection to avoid "Null userid is not supported"  thrown from the backend. 
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-538
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-538
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Fay Wang
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-538.637439.patch
>
>
> [jcc][t4][10205][11234][3.51.74] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815
> org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4054)
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:501)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:80)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:402)
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:592)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:464)
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:440)
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:576)
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:517)
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2814)
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.