Deadlock Loading Form in Tab Panel

Questions and answers for designing and implementing forms in Servoy

Deadlock Loading Form in Tab Panel

Postby gdurniak » Wed Apr 10, 2013 6:22 pm

We upgraded from Servoy 3.1 to 6.1, and now get Deadlock errors in the Server Log

using Sybase 10.0.1

it's a simple Form with a Tab Panel. A Global Method Finds the records in each Tab Panel form

The server log shows what looks like two Load Found Set queries: e.g. "Select serial_numbers from Table ..." and "Select columns From Table where serial_number IN ... "

it is our main page, so it happens often, with about 9 users

any way to debug this ?

greg
Last edited by gdurniak on Thu Apr 25, 2013 3:37 pm, edited 2 times in total.
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Deadlock Loading Form in Tab Panel

Postby rgansevles » Mon Apr 15, 2013 10:25 am

Greg,

Do you use long-running transactions?

Can you show the error from the log file?

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Deadlock Loading Form in Tab Panel

Postby gdurniak » Tue Apr 16, 2013 3:33 pm

We have no real "transactions", but do run some report queries that might take up to a minute to complete

This is the error:

com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -306: Deadlock detected
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.tds.TdsResultSet.nextResult(Unknown Source)
at com.sybase.jdbc3.tds.TdsResultSet.next(Unknown Source)
at com.sybase.jdbc3.jdbc.SybCursorResultSet.next(Unknown Source)
at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
at com.servoy.j2db.dataprocessing.Zv.createBufferedDataSet(Zv.java:671)
at com.servoy.j2db.dataprocessing.Zv.Za(Zv.java:989)
at com.servoy.j2db.dataprocessing.Zv.Za(Zv.java:1001)
at com.servoy.j2db.dataprocessing.Zv.Za(Zv.java:57)
at com.servoy.j2db.dataprocessing.Zv.performQuery(Zv.java:1250)
at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Last edited by gdurniak on Tue Apr 16, 2013 10:43 pm, edited 1 time in total.
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Deadlock Loading Form in Tab Panel

Postby rgansevles » Tue Apr 16, 2013 9:52 pm

Greg,

Sounds to me that a foundset query (which is always pk-based) should not take a minute.
I guess the client query is blocked and selected as deadlock victim after some time.

Check what else is running when 1 client is blocked.
The admin page in 6.1 also shows running queries.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Deadlock Loading Form in Tab Panel

Postby gdurniak » Wed Apr 24, 2013 2:47 pm

Using Application Profiling in Sybase Central, it appears that the server requests are fighting for the same connection

It seems the Sybase locking scheme by default is "allpages". Perhaps I could make this "datapages"

The database has the default 10 Active and 5 Idle connections. Doubling this makes no difference

idle timeout is -1

We usually have 8 or 9 concurrent users

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Deadlock Loading Form in Tab Panel

Postby gdurniak » Mon Apr 29, 2013 5:51 pm

( cont'd )

From the Server Log, I see e.g. 14 deadlock errors in one minute, from 7 of the 9 clients

They are ALL trying to Load Foundset, from the same Table

Perhaps a record was edited, and the change is being broadcast ?

Since the Performance Log does not give Date and Time, it is hard to tell which query starts it

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Deadlock Loading Form in Tab Panel

Postby gdurniak » Wed May 01, 2013 4:08 pm

I found a post from Johan C, saying you should never just "ShowForm". That it must have a Found Set

Is this still true ? Perhaps this is my problem ...

In my "opener" method, I do start with a Found Set in all Tables

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Deadlock Loading Form in Tab Panel

Postby gdurniak » Mon May 06, 2013 11:04 am

I see now that this is a data broadcast problem, and have posted it here instead:

viewtopic.php?f=2&t=19487

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA


Return to Forms

Who is online

Users browsing this forum: No registered users and 9 guests