https://bz.apache.org/bugzilla/show_bug.cgi?id=58055

            Bug ID: 58055
           Summary: initConnectionSqls property of Resource inside
                    context.xml has issues when Oracle is used as database
                    server
           Product: Tomcat 7
           Version: 7.0.62
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: dhryvas...@serena.com

Hi -
We are using Tobcat as our application server and have some problems with
context.xml. There are some actions that we want to do in the database when new
connection is established. SQL query that we want to run is "BEGIN
DBMS_SESSION.SET_IDENTIFIER('SBM_TOMCAT'); END;". To do this, we have added
property initConnectionSqls to the Resource object in context.xml. But ";"
(semicolon) efore the END are treated as a separator between different SQL
queries and cut version of query is sent to Oracle. Oracle in turn reports an
error:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-06550: line 1, column 47:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:

   := . ( % ;
)
    at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
...

We tried to change our SQL to something that does not contain ";", for example 
"EXEC DBMS_SESSION.SET_IDENTIFIER('SBM_TOMCAT');", but got another error:
Caused by: java.sql.SQLException: ORA-00900: invalid SQL statement.
The interesting thing is that both SQL queries are working fine if to run them
from Oracle SQL Developer.
Another fact is that the same functionality with the same SQL is working fine
on Jboss (we are now moving from Jboss to Tomcat and faced with such a
problem).

Please, help us to fix it or at least find workaround for it.

Thanks,
Denys

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to