'Error in relation', and 'cannot save form data'

Hi all

My solution, in production, frequently gives ‘Error in relation’, and ‘cannot save form data’ errors on the local network. Servoy developer shows 0 errors, 0 warnings, 0 infos in the problems tab, and I have not seen these errors connecting to the solution remotely, nor on my own network, however I do not use it anywhere near as intensely as my client does (although they only have 5 users, and a few thousand lines in the main table).

Is this an error in my coding, or could their network be the issue (which I suspect). I am struggling with them continually complaining about this issue, and don’t know what to fix.

Any pointers would be appreciated

Bevil

Bevil, which version of Servoy?
I remember something, that there was an update, fixing this…

Hi Harjo, it is Servoy version 4.1.6 -build 689

they fixed/enhanced something in 5! see here: http://forum.servoy.com/viewtopic.php?f=6&t=13438 (topic of Johan)
for the rest, you can take look at your servoy-admin page, in the log, what is really going wrong here… why you can’t save data…

Hey Harjo

I tried moving my solution to 5. I learned my lesson and will not try that again…

Surely though there isn’t a bug in 4 that causes this problem, is there??

when do they get that error?
only when browsing? So the network connection is always ok, the laptop/pc isnt suspended for a while and so on?

If it happens just when the client laptop/pc is up and running all the time, then it is a problem with the network that is closing the connection now and then.

In 5 we made some improvements but that is only when the network is really been down (on purpose or by accident once or twice) so that the error handling is better
It doesnt fix the actual problem of the network connection (that would be a bit hard to fix…)

They get this error when simply using their solution, no action in particular causes it (I can’t see a clear pattern)

I strongly suspect that their network is the problem although for now, I am not allowed to fix it myself (they have an incumbent IT support company who look after the network / machines). I see the same error myself with our solution if I change networks, or put my machine to sleep while Servoy is open - suggesting that it MUST be a network issue). The only slight pattern they have identified is that the internet is often unavailable when they get these errors. The errors generally only affects one user at a time.

If there is nothing that my coding or solution might be doing to cause this error then I can take that back to them and tell them that until we can fix their network, they have to put up with this issue. Is there any way to be certain?

if the network is randomly disconnecting then you cant do much in the solution for that.
You could ask if they open a java console and then give you the console output when it happens. Then you can see if they are really connections errors.

Attached is a copy of the console log during an ‘error in relation’ (I had this while connecting to the solution from outside, but I assume it is related to the problem they have internally.)

My calculation which it complains about toward the end of the log is:

function additional_data_for_line()
{
if (internal_note || line_items_to_images.image_blob || invoice_credit)
	{
	
	
		var vhtml = '<html><body><b>'
		
		if (line_items_to_invoices_using_invoice_number)
				{
				if (!line_items_to_invoices_using_invoice_number.invoice_credit)
					{					
					}
				else
					{
					vhtml += line_items_to_invoices_using_invoice_number.invoice_credit
					}
				}
		if (line_items_to_images.image_blob)
				{
				vhtml += 'p'
				}
		if (internal_note)
				{
				vhtml += 'n'
				}


	vhtml += '</b></body></html>'
	return vhtml
	}
	else
	{
	return '<html><body></body></html>'
	}

}

This log was copied very soon after the ‘error in relation’ error, and only a minute or two after opening the solution.

I don’t know whether a problem with this calculation is causing the error in relation, or whether a network error is causing a problem connecting to the database (I have a persistent ping reply during the issue, with one or two dropped packets per 30 seconds or so).

Any help would be appreciated…

:)

Bevil

Console errors during error in relation.txt (155 KB)

Bevil,

The nullpointer is a rethrow of an exception in the Servoy Server.
Can you find the original stacktrace in the servers’ logfile? With that we may be able to see the cause.

Rob

Hi Rob

I am not able to cross reference the stacktrace with a log because I am not onsite and of course I don’t have these problems when I connect to the system. I have however copied part of the server log and attached it here. They apparently are having significant errors with this today, continually restarting Servoy client because of it.

Anything you can see in the log which would indicate that it IS the network?

Thanks

Bevil

servoy_log_3.txt (1.65 MB)

Bevil,

It seems that the connection from server to sybase is having problems (JZ0C0: Connection is already closed).
Servoy keeps trying to use the connection which results in these many errors.

I would suggest to configure meta-data validation or query validation (some simple query like ‘select 1’) for the server connection and restart Servoy Server.

Hope this helps,

Rob

Hi Rob

Forgive my ignorance, but where/how do I configure meta-data validation or query validation?

Bevil

Hi Bevil,

On the server you do this in the Servoy-Admin pages under the Database Servers page.
Here you see the Query Validation Type field where you can set to “meta-data validation” or “query validation”.
If you use that last setting then also fill in the Validation Query field with “select 1;”

In developer you can do all this in the connection edit window.

Hope this helps.

Hi Robert

Yes, I found that and did it.

I am in the dark though about why this solution in particular has this problem (it is a branch of another solution which does much the same kind of thing, but doesn’t have this problem)

I also have no idea what the ‘select 1’ in query validation is or does???

Also, presumably the select 1 should have no inverted commas?

Thanks

Bevil

Hi Bevil,

Since it looks like that the database closes/looses the connection do you see anything in the database log (from sybase I assume).

As for the query validation this just means that Servoy will perform the ‘select 1’ before every query to check if the connection is still alive. If not it logs an error and opens a new connection and continues. it’s a more pro-active approach on checking the status of the connection.

Hi Robert

I don’t see anything worrying in Sybase log. No errors, only information.

See log attached.

sybase_log.txt (85.7 KB)

I wonder if the reason for this issue is to do with the number of connections to the database that I have.

My customer has 5 licenses for Servoy. Recently I saw that they had 10/10 connections to the (important) database. I changed all the database to a maximum of 30 connections, and 20 idle connections. Currently they have 7/20 idle connections, however this doesn’t make sense if there are only 5 licenses (and currently only 3 users in the system.) What opens connections and doesn’t close them? I do use some SQL queries, these don’t have to be explicitly closed do they?

Thanks

Bevil

Hi Bevil,

One client can use multiple connections from the database connection pool when it needs to fire multiple queries at once. For example if you have a table with images and you show them in a listview then the more connections you have defined the faster the images show from the database.
As for the 7/20 number. You did set it to keep 20 connections open (even if idle).
As for not closing, connections won’t be closed when there are still queries running or when a connection is in a database transaction.

Hope this helps.

I am still struggling with this issue, it has never gone away despite the network connection being replaced, the operating systems of the server and clients switching from Mac/Windows to Mac/Mac, etc.

Frequently some (not all) clients will end up in an endless loop of ‘cannot save form data’ and ‘error in relation’

My database connections still frequently show strange numbers (like ‘-40/30’), and the client has just grown used to the fact that they have to kill servoy clients (often forcibly), or click endlessly on error ‘ok’ buttons to make the issue go away.

I have a console log and server log from during an episode, top of the server log attached…

Any help would be appreciated.

Bevil