0

I need to stop a procedure that run in oracle database by clicking in a "stop" button on my interface. I try to kill the thread that start the procedure but the database process continues after this.

Is that possible to identify the session created by hibernate in the oracle database, responsible to execute the procedure, to kill it?

tech4
  • 541
  • 2
  • 14
  • 37

1 Answers1

0

Hibernate uses JDBC call statement for executing procedures. On executing it triggers that thread on the database server instance. database session or the word session refers to JDBC connection. This needs to be killed on the database server by a DBA.

For reference you may use following sqls:

To find the session:

select * from v$session where username = 'baduser';

Say the session = 8,1082

To kill the session:

alter system kill session '8,1082';

bhantol
  • 9,368
  • 7
  • 44
  • 81
  • You sure your app has an active connection to database using 'baduser' user ID while you queried 'v$session' – bhantol Oct 26 '16 at 11:45
  • Yes, but my user have a lot of sessions open..i cannot kill all of them i need to know what is responsible for the procedure. – tech4 Oct 26 '16 at 16:37
  • Try something along the lines of http://stackoverflow.com/a/18025278/2103767 to get the specific session – bhantol Oct 26 '16 at 16:48