问题
I have a weird situation with debugging pl sql code.
I set sql developer to listen for debug connections. In java code I attach debugger with following code:
CallableStatement cstmt = null;
try {
cstmt = getConnection().prepareCall("begin DBMS_DEBUG_JDWP.CONNECT_TCP( '10.1.1.17', 4000); end;");
cstmt.execute();
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeStatement(cstmt);
}
Debugger connects successfully, i.e. I can see in sql developer in Run Manager
that connection exists.
Despite connection is created debugger does not work. Sometimes breakpoints are not ticked with a green mark, sometimes they are, but breakpoints still do not work. In any case debugger does not stop on breaks, procedures that are called successfully executed as if there are not breaks.
Packages where I put breaks are compiled for debug, Start Debugger Option
is set to Step Over
. I also tried to Sql Developer
3.2.2 and 3.0.6, 3.0.4 with the same behaviour. User which I use from 'Sql Developer' and from application are the same and this user has debug privileges (DEBUG CONNECT SESSION
, DEBUG ANY PROCEDURE
). I am run out of ideas how to make it work.
What to try next, how to diagnose this problem?
回答1:
I found root issue. It is not about oracle, it is about application server and connection to database. I was attaching debugger in one bean and calling plsql procedures in other bean. As they were in the same transaction I thought that connection should be shared, but it did not. So I just moved debugger attachment to bean where procedures were called and now it works finely.
来源:https://stackoverflow.com/questions/16497188/plsql-remote-debug-breakpoints-not-working