You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "vinay shukl (JIRA)" <ji...@apache.org> on 2010/01/11 12:56:54 UTC

[jira] Created: (DERBY-4511) Error while Retrieving view data from database

Error while Retrieving view data from database    
--------------------------------------------------

                 Key: DERBY-4511
                 URL: https://issues.apache.org/jira/browse/DERBY-4511
             Project: Derby
          Issue Type: Bug
          Components: SQL
            Reporter: vinay shukl


I am running an application ,in which I have used Apache Derby as a backend.
While retrieving the values from resultset i am getting below error.

ERROR 38001: The external routine is not allowed to execute SQL statements.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798666#action_12798666 ] 

Rick Hillegas commented on DERBY-4511:
--------------------------------------

Hi Vinay,

Could you include a test case which shows this problem? The error you are seeing is raised by Derby if you declare that a function/procedure does not issue SQL but it actually does issue SQL when executed. Examine your CREATE FUNCTION or CREATE PROCEDURE statement to make sure that it does not include the NO SQL clause. If the CREATE FUNCTION/PROCEDURE statement does include that clause, then replace the clause with CONTAINS SQL or READS SQL DATA or MODIFIES SQL DATA, depending on what your function/procedure actually does. The meaning of these clauses can be found in the Reference Guide sections on the CREATE FUNCTION and CREATE PROCEDURE statements.

Thanks,
-Rick

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798673#action_12798673 ] 

Dag H. Wanvik commented on DERBY-4511:
--------------------------------------

This error happens when trying to perform a DELETE for which the SQL session does not hold sufficient privileges,
presumably of a trigger since the delete is  called from a method called deleteExpiredAndFinishedTriggers.

It is not obvious that this is a Derby error. Can you show what SQL is being executed and why you think Derby is not behaving correctly?


> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799122#action_12799122 ] 

Knut Anders Hatlen commented on DERBY-4511:
-------------------------------------------

The stack trace in the last comment may be from a SELECT ... FOR UPDATE statement, but the stack trace in the bug description looks like a DELETE statement. It is true that this error should be raised if SELECT or DELETE is executed from within a function/procedure declared with NO SQL, but there's no sign of a function/procedure invocation in the stack traces, so it looks like a Derby bug to me.

Which version of Derby are you using?

The issue is flagged as a regression. Does this mean that it used to work with older versions of Derby? If so, which Derby versions have this problem, and which versions don't?

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800646#action_12800646 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Hi,

We are using the very latest version of derby so it is clear that the issue is on latest version. 
Unfortunately i dnt have the repro case but it is just that we are executing sql statement to update a row in db and it is failing with the error mentioned.
With other DB like oracle i am able to execute the statement.

Thanks,
Vinay

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799568#action_12799568 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Derby v10.2.2000000.485682

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803646#action_12803646 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Hi,

It is very difficult for us to upgrade as this moment. could you check the similar kind of issue and let me know the resolution.

Thanks,
Vinay

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799074#action_12799074 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Daq,

I am not sure if it is really a derby error, but this error i am getting is coming out of two different places oen is from our dispatcher code where is it propogating from deleteExpiredAndFinishedTriggers the stack trace for the same is in discription and another place where i am getting the same error is our scheduler the stach trace is below

java.sql.SQLException: The external routine is not allowed to execute SQL statements.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
at org.apache.derby.exe.ac08264012x0125xba57x12adx00000e7f746f15.fillResultSet(Unknown Source)
at org.apache.derby.exe.ac08264012x0125xba57x12adx00000e7f746f15.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
at com.wm.app.b2b.server.scheduler.ScheduleDB.completeTask(ScheduleDB.java:1434)
at com.wm.app.b2b.server.scheduler.ScheduleDB$ScheduledService.run(ScheduleDB.java:2462)
at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
at java.lang.Thread.run(Thread.java:595)

Let me know if it is sufficient enough to diagnose the problem.

Thanks,
Vinay

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800571#action_12800571 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Any updates?

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801681#action_12801681 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

It is 10.2.2.0
Thanks,
vinay

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800616#action_12800616 ] 

Knut Anders Hatlen commented on DERBY-4511:
-------------------------------------------

Hi Vinay,

It might speed up the process if you're able to provide a test case that reproduces this problem. Also, it would be helpful if you could check whether the problem is reproducible on the latest version of Derby. 10.2.2.0 was released more than three years ago, and lots of bugs have been fixed since then.

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800677#action_12800677 ] 

Knut Anders Hatlen commented on DERBY-4511:
-------------------------------------------

Thanks for the update, Vinay.

I'm afraid it might be difficult for others to reproduce this. Since you're the only one who knows exactly what kind of queries that are executed against your database, you're probably in a better position to find out how to reproduce it. Although it's not required to have a reproducible test case, having one will greatly increase the chances of getting the bug fixed.

Also, could you please clarify exactly which version of Derby you are seeing this on? I see one comment stating 10.2.2.0, and one stating "latest". By "latest", do you mean 10.5.3.0?

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801727#action_12801727 ] 

Knut Anders Hatlen commented on DERBY-4511:
-------------------------------------------

Hi Vinay,

The latest version of Derby is currently 10.5.3.0. It would be great if you could try that version and see if you get the same problems there. It would also be great if you could enable more logging by setting the following properties

derby.stream.error.logSeverityLevel=0
derby.language.logStatementText=true

and attach the contents of derby.log when you see the error.

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Updated: (DERBY-4511) Error while Retrieving view data from database

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4511:
--------------------------------------

     Affects Version/s: 10.2.2.0
    Bug behavior facts: [Seen in production]  (was: [Seen in production, Regression])

Setting affects version field to 10.2.2.0 based on reporter's feedback. Clearing the regression flag.

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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


[jira] Commented: (DERBY-4511) Error while Retrieving view data from database

Posted by "vinay shukl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799073#action_12799073 ] 

vinay shukl commented on DERBY-4511:
------------------------------------

Rick,

Thansk for your quick reply. The test case is that we have a db table where we have record of our schedule tasks(Scheduler Functionality). Our server picks task and run it, after completion of the task it updates the db with next run parameter. 

The error appears to occur when Scheduler is performing a "SELECT ... FOR UPDATE" to retrieve the scheduled task data from table. The error itself suggests that some sort of authorization failed, but I'm unfamiliar with how Derby handles access-privileges.

In any case, what I've noticed is that org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Activation, int) performs a verification to determine if the current instance of org.apache.derby.impl.sql.conn.GenericStatementContext has the appropriate privileges for the current operation (e.g. READ, WRITE or CALL). By default, the GenericStatementContent is given full-access.

GenericStatementContent.getSQLAllowed() is called to retrieve the current access-level. This method could potentially return no-access (org.apache.derby.catalog.types.RoutineAliasInfo.NO_SQL) if the current instance is set as "not in use". However, I haven't been able to determine a scenario which could possibly flag the GenericStatementContext as "not in use", because it's explicitly set to "in use" earlier; org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.pushStatementContext().

The issue is intermittent, so I doubt there's anything wrong with the actual table or data. 

Hope this much information will help.

Thanks,
Vinay

> Error while Retrieving view data from database    
> --------------------------------------------------
>
>                 Key: DERBY-4511
>                 URL: https://issues.apache.org/jira/browse/DERBY-4511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: vinay shukl
>
> I am running an application ,in which I have used Apache Derby as a backend.
> While retrieving the values from resultset i am getting below error.
> ERROR 38001: The external routine is not allowed to execute SQL statements.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.externalRoutineException(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(Unknown Source)
> at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDeleteCascadeResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.fillResultSet(Unknown Source)
> at org.apache.derby.exe.aceeb848bfx0125xd416xdf4ex00000e7f746f8c.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
> at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> at com.wm.app.b2b.server.dispatcher.JoinDBUtil.deleteExpiredAndFinishedTriggers(JoinDBUtil.java:396)
> at com.wm.app.b2b.server.dispatcher.JoinManager$JoinManagerTimeoutThread.run(JoinManager.java:200)
> at com.wm.util.pool.PooledThread.run(PooledThread.java:118)
> at java.lang.Thread.run(Thread.java:595) 

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