Significant problem with 2.2.3

I have been waiting for someone else to complain, but since no one is speaking up I will. Their is a general problem in 2.2.3 that did not exist in 2.2.1 where one can use Servoy to add new rows to tables but when those tables are displayed it is as if Servoy is unaware of the data. For instance I use the below script to add rows to a table called ‘examination’ and add related rows to related tables. If I then Show the data in the last line of the code I get an error message in the onShow saying certain values are not defined. When I look in the backend database the undefined values have been stored in the backend database. If I refresh the application from the database just prior to showing the form [next to last line of code commented out] I do not get the error. This is a very big problem with 2.2.3. I am still running 2.2.1 without this issue. [I am not sure if this is related to the problem but I should not that we always let the backend database create the primary key by setting it to database identity.]

var thedate = application.getServerTimeStamp()
thedate = globals.NextDay(thedate);
var thefinaldate = utils.dateFormat(thedate,‘MM/dd/yyyy’);
var thebeginningdate = utils.dateFormat(application.getServerTimeStamp(),‘MM/dd/yyyy’);
var maxReturedRows = 5;//usefull to limit number of rows
var query = ‘SELECT examinationid’
query += ’ FROM examination’
query += " WHERE demographicsid =‘" + demographicsid + "’"
query += " AND date_created >= ‘" + thebeginningdate + "’"
query += " AND date_created < ‘" + thefinaldate + "’"
var foundset = databaseManager.getDataSetByQuery(controller.getServerName(), query,null, maxReturedRows);
var recordCount = foundset.getMaxRowIndex()
if(recordCount > 0)
{
var x = plugins.dialogs.showInputDialog(‘Warning: More than one exam this date!’, ‘Second exam this date?’)
if(x != ‘Second exam this date’)
{
return;
}
}
globals.license();
demographics_to_examination.newRecord()
demographics_to_examination.doctors_initial_phone = doctors_initial_phone
demographics_to_examination.date_created = globals.date_without_time(application.getServerTimeStamp());
controller.saveData()
var theid = demographics_to_examination.examinationid
//had problems in the past getting the billing_master made??
demographics_to_billing_master.newRecord()
demographics_to_billing_master.examinationid = theid
controller.saveData()
//be sure all parameters are recalculated.
databaseManager.recalculate(demographics_to_billing_master)
demographics_to_examination_anterior_segment.newRecord()
demographics_to_examination_anterior_segment.examinationid = theid
controller.saveData()
demographics_to_examination_eyelid.newRecord()
demographics_to_examination_eyelid.examinationid = theid
controller.saveData()
demographics_to_examination_lacrimal.newRecord()
demographics_to_examination_lacrimal.examinationid = theid
controller.saveData()
demographics_to_examination_motility.newRecord()
demographics_to_examination_motility.examinationid = theid
controller.saveData()
demographics_to_examination_nerve.newRecord()
demographics_to_examination_nerve.examinationid = theid
controller.saveData()
demographics_to_examination_optics.newRecord()
demographics_to_examination_optics.examinationid = theid
controller.saveData()
demographics_to_examination_orbit.newRecord()
demographics_to_examination_orbit.examinationid = theid
controller.saveData()
demographics_to_examination_socket.newRecord()
demographics_to_examination_socket.examinationid = theid
controller.saveData()
demographics_to_examination_vision.newRecord()
demographics_to_examination_vision.examinationid = theid
controller.saveData()
demographics_to_prescription_master.newRecord()
demographics_to_prescription_master.examinationid = theid
demographics_to_prescription_master.doctors_initial_phone = doctors_initial_phone
controller.saveData()
if(contact_to_preferences.record_locking == 1)
{
var success = databaseManager.acquireLock(demographics_to_examination,-1)
}
//determine how many examination records this patient had
var maxReturedRows = 10000;//usefull to limit number of rows
var query = ‘SELECT examinationid’
query += ’ FROM examination’
query += " WHERE demographicsid =‘" + demographicsid + "’"
var foundset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
var count = foundset.getMaxRowIndex()
forms.examination_controller.controller.loadRecords(foundset)
forms.examination_controller.controller.setSelectedIndex(count)
//globals.RefreshFromDatabase();
forms.examination_controller.controller.show()

Thanks

John McCann
Windows
Java 1.4.x
Microsoft SQL Server

Since upgrading to 2.2.3 from 2.2.1, I’m experiencing big problems with Servoy losing track of records/relationships and I’m also using SQL Server with db identity keys.

Here’s an example:

  • on a quote, I create a new line item, which in turn creates one child record in the ‘Miscellaneous item’ table

  • I do controller.saveData() on the new records and I can see that all the db-generated primary keys have been set properly

  • I pop up a form-in-dialog, showing a form based on ‘Miscellaneous item’ that also includes fields from its parent, the line item

  • I type in one of the fields from the parent line item, Servoy accepts the value and writes it to the database, but then this and all of the other values from the parent disappear from the form

  • No further changes can be made to the parent line item record’s fields from the child until I have switched into design mode and back. Then everything works fine for existing records, but the problem resurfaces with each new record

A video of this phenomena is here if the Servoy devs are interested:
http://homepage.mac.com/darrenjclarke/F … ing11.html (watch the price get entered in the form-in-dialog and then magically disappear).

May be related to:
http://forum.servoy.com/viewtopic.php?t=5640
and/or
http://forum.servoy.com/viewtopic.php?t=5605

Windows
Java 1.5
2.2.3
SQL Server 2000 using Microsoft’s JDBC drivers

It sound like we both have the same problem. I hope it can be adressed in the next release.

John McCann

Will chime in as well. We have a good working example of this problem with Sybase as the backend. Database managed keys. Creating related records where the relationship has only one match works fine. Lose about 10% to 20% of records that are created via a relationship that has two matches – one of which is a global on the left side. No amount of throwing in the saveData() function at various places helps.

Let me know if you want me to send this solution over.

We also found an issue with new db-ident pk values used in a relation, we have a fix which will be release in 2.2.4 within several days.

In the mean time if this is a major problem, update with the following jars:
2 Servoy lib jars:
http://downloads.servoy.com/downloads/2 … 2dbdev.jar
http://downloads.servoy.com/downloads/2 … t/j2db.jar

2 plugins are changed:
http://downloads.servoy.com/downloads/b … upmenu.jar
http://downloads.servoy.com/downloads/b … eduler.jar

BTW please do mail support@servoy.com, if serious issues arise. (sometimes we overlook posts like this)

I experience the same: Relationship is becoming broken - Classic Servoy - Servoy Community

And I agree it seems to be related to the fact that the relationship in question uses more than one criteria, one beeing a global. But I also see that those records are indeed created, they are just not loaded into Servoy.

Anyone tried the new jars?
and did it fix the problem?

I am testing. I see, however, one other problem related to relations using globals.

In the messages table, reference keys are stored with a message_language NULL if created by Servoy’s i18n tools. When I try to rebuild the i18n logic by myself, I need to setup a relationship that points to those NULL values for the reference key. I have setup a relationship using two globals, one for the key and one for the language. In case of the reference value I have tried three ways:

  1. Setting the language global to “null” as default value: the result is the String “null” in the language key column?!
  2. Setting the language global to “null” using a method (globals.xxx = null): the result is an empty String in the language key column (not NULL!) or the value “NullV” if the record was newly created.
  3. Not setting the language global to anything: the result is an empty String in the language key column

So the question is: how can I force a NULL value using a relation?

Could anyone have a look at this, please?

Thanks
Patrick

Regarding testing the new builds:

One of my methods that created a popup-menu now gives me this:

org.mozilla.javascript.JavaScriptException: java.lang.ClassCastException: java.lang.Object
org.mozilla.javascript.JavaScriptException: java.lang.ClassCastException: java.lang.Object
at org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException.java:71)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:381)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2031)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.a(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel.a(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel.access$5(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel$5.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.ClassCastException: java.lang.Object
at com.servoy.r2.plugins.popupmenu.PopupMenuProvider.createMenuItem(PopupMenuProvider.java:236)
at com.servoy.r2.plugins.popupmenu.PopupMenuProvider.js_createMenuItem(PopupMenuProvider.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:347)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2031)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.a(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel.a(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel.access$5(Unknown Source)
at com.servoy.j2db.dataui.AbstractScriptLabel$5.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Is this a new feature or a bug?

The jars solved my import/export issue posted elsewhere…

after upgrading to 2.2.3_04 I have the following problems:

  1. all labels of my application, also in printpreview, now have a thin black line border
  2. a batch application that used to mail once a day with a scheduled is not working anymore (no messages in log)

I did not change the applications, just upgraded servoy and restarted the server, is anyone else having similar problems?

thanks in advance

  1. please check your styles, they are not well defined, you need something extra like “border-color: transparent” (a solid border is a thick line border)
  2. did you also update the scheduler plugin?

Hello Jan,

hava the arguments of the popupmenu changed somehow? See my error above…

Thanks
Patrick

patrick can you send me the script you use to call the popupmenu plugin?
we have customers that are working fine with that plugin but somehow there is a call to it that gives that class cast exception.

I will also test the scheduler once more to see if it works.
The same goes for this one. Please give me a script how you call the scheduler.

Johan… in your mail… thk

ok i think i have found it.
Does it also give the classcast exception when you first load the soution?
Or only when you have done “Verify” once in the method editor?

i think i have nailed the problems you guys are having
Can you test it by redownloading all 4 jars:

2 Servoy lib jars:
http://downloads.servoy.com/downloads/2 … 2dbdev.jar
http://downloads.servoy.com/downloads/2 … t/j2db.jar

2 plugins are changed:
http://downloads.servoy.com/downloads/b … upmenu.jar
http://downloads.servoy.com/downloads/b … eduler.jar

Bingo Johan,

the last update solved my problems!

thank you

Problem resolved in 2.2.4.

Thanks

John McCann
Java 1.4.x
Windows 2003 Server
Windows XP