cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I see if a deadlock occurs on the system?

ksk_natsume
Inactive

Hi, This is Ryotaro

I would like to answer questions from customers.
How can I check by Dynatrace Appmon if a deadlock occurs on the system?
My customer want to identify the cause by instantly identifying the occurrence of deadlock.

Is it displayed as an error on error dashlet?
Should check from database dashlet by response time etc?

Best Regards

Ryotaro

13 REPLIES 13

ksk_natsume
Inactive

Hi, could you tell me any imformation about it?

I have to explain to our customer tomorrow!

This answer may decide whether to introduce Dynatrace to the production environment or not.

Best Regards

Ryotaro

Babar_Qayyum
Leader

Hello Ryotaro,

Thread dumps provide a snapshot of all JVM/CLR threads. They are a powerful way of finding deadlocks, idle or busy thread pools, thread leaks, and more.

Have a look on the following link:

https://www.dynatrace.com/support/doc/appmon/appli...

The database live view gives you a quick overview on what is currently running on the database instance. All the data available in the Database Live View is retrieved in real time e.g.


  • Sessions / users connected to the database instance
  • Wait States
  • Slow Queries currently active
  • Locks currently active
  • Tablespace ‐ total and free size; available for Oracle only

https://www.dynatrace.com/support/doc/appmon/datab...

Regards,

Babar

sjoerd1
Advisor

Hi Ryotaro,

As soon as the DBMS detects there's a deadlock, it will choose a deadlock-victim, and terminate that transaction, so that the other transaction can continue (depending on which DBMS). This will be seen in the "Errors" dashlet in the "Diagnose events" menu of AppMon.

In that case you get a database exception "BreakNetException" message "Break Packet Received".

When analysing you can immediately drill-down to the impacted PurePath and analyse the involved SQL statement and the order of preceding statements.

(Un)fortunately I cannot find an example of this right now in the customer application, otherwise I could have shown how it looked in an Oracle environment...

Also the new database-agent has a live view on current locks, but as mentioned, the application hasn't created a deadlock for a long time, hence I cannot give examples...

Hope this helps (a little).

Cheers,

Sjoerd

In the PurePath, you will see the SQL statement with an "errorBadge", and probably will see a similar detail message like this: "java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource"

HI,Sjoerd

I want to ask about more detail for your answer.

>As soon as the DBMS detects there's a deadlock, it will choose a

>deadlock-victim, and terminate that transaction, so that the other

>transaction can continue (depending on which DBMS). This will

>be seen in the "Errors" dashlet in the "Diagnose events" menu of

>AppMon.

In case using Oracle as DBMS, Is the process to solve the deadlock, the default function?


I mean, I want to know, I have to any setting on Oracle, or not.

Even on the dynatrace side, I do not need to change the sensor, I can see the error, right?

If I need any setting, I have to tell our customer as well.

so please tell me about it.

Best Regards

Ryotaro

Deadlock detection is something that Oracle does by default. If it sees that session A is waiting for session b, and session b is waiting for a, it will kill one of them (based on algorithm).

There are also (session based) settings like lock-timeout etc how long an application is waiting for locks etc.

The main story remains that Oracle will terminate the transaction and respond with an exception that contains the ORA-...... error. This same kind of error handling is also visible with e.g. db-constraint errors.

Creating alerts on a specific ORA-.... message is a challenge, unless the application has specific handling of the message, or logs those messages to e.g. log4j. This is quite application specific.

HI,Sjoerd

thankyou for your answer!

I understand, I don't have to any setting change on Oracle.

If I don't need specific aleart, I can see the exception without any setting change on Dynatrace as well right?

Best Regards

Ryotaro

Hi, All

then, could anyone show me examples about the database exception "BreakNetException" message "Break Packet Received"?

If I can get picture, It will really helpful to explain to our customer though.

Best Regards

Ryotaro

Hello Ryotaro,

Below screenshot is an example of exception which is reffered by @Sjoerd B.

Regards,

Babar

Hi, Babar

Thank you so much.

Hi,All.

Would Anyone give to me sessiondata which is inclede the exception of "dead lock"?

Because, I have to presentation to our customer, then I want to show them "How to drill down of the database exception".

The masked session data is ok.
I will do the presentation on 4th. so I want to get the data until 1st.
I am sorry to trouble you, but I appreciate your cooperation.

Best Regards
Ryotaro

ksk_natsume
Inactive

Hi, Babar and Sjoerd,

Thank you for your answer!

I'll explain to our customer, thx.

Best Regards

Ryotaro

ksk_natsume
Inactive

Hi,All.

Would Anyone give to me sessiondata which is inclede the exception of "dead lock"?

Because, I have to presentation to our customer, then I want to show them "How to drill down of the database exception".

The masked session data is ok.
I will do the presentation on 4th. so I want to get the data until 1st.
I am sorry to trouble you, but I appreciate your cooperation.

Best Regards
Ryotaro