JSON: Multi-threaded .net object problem ?

Posted by jmls on 20-May-2012 14:14

I've got a large program (too big to show here), but there is one line of code that, when present, causes the dreaded 15740 error:

You are trying to use a multi-threaded .NET object in a way that is not supported.  The ABL cannot be called on a thread other than the main thread. (15740)

The ABL is single threaded.  You will see this error if you use a .NET object that employs multiple threads and attempts to call back to the ABL on a thread other than the main processing thread.

When this line is commented out, then the error does not happen. The line in question is
Json = (NEW utilities.JsonParser()):GetJson(p_Data)
where utilities.JsonParser is shown below.
As you can see, there is no .net involved here , unless Progress.Json.* uses it in the background.
What is happening ?
And, more importantly, can it be fixed ?
using Progress.Json.ObjectModel.*.
routine-level on error undo, throw.

class utilities.JsonParser:
     
  method public JsonObject GetJson(p_Data as longchar ):
    def var lv_Data as longchar no-undo.
   
    fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */
   
    assign lv_Data = p_Data.
   
    return cast((new ObjectModelParser()):Parse(lv_Data),Progress.Json.ObjectModel.JsonObject).
   
    catch e as Progress.Lang.Error :
      return      new Progress.Json.ObjectModel.JsonObject().
    end catch. 

  end method.

end class.

All Replies

Posted by jmls on 21-May-2012 00:50

ok, breaking it down, removing all the fancy stuff,

JsonConstruct1   = JsonObjectModel1:Parse(lv_Data).

A fuller version is shown below.

is where the error ocurrs according to the protrace file.

    def var JsonConstruct1   as Progress.Json.ObjectModel.JsonConstruct     no-undo.

    def var JsonObjectModel1 as Progress.Json.ObjectModel.ObjectModelParser no-undo.

    fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */

    assign lv_Data = p_Data.

    JsonObjectModel1 = new ObjectModelParser().

    JsonConstruct1   = JsonObjectModel1:Parse(lv_Data).

Posted by Peter Judge on 21-May-2012 08:04

jmls wrote:

ok, breaking it down, removing all the fancy stuff,

JsonConstruct1   = JsonObjectModel1:Parse(lv_Data).

A fuller version is shown below.

is where the error ocurrs according to the protrace file.

    def var JsonConstruct1   as Progress.Json.ObjectModel.JsonConstruct     no-undo.
    def var JsonObjectModel1 as Progress.Json.ObjectModel.ObjectModelParser no-undo.

    fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */

    assign lv_Data = p_Data.

    JsonObjectModel1 = new ObjectModelParser().
    JsonConstruct1   = JsonObjectModel1:Parse(lv_Data).



Sounds buggy to me. Does it always happen, or only with certain data?

-- peter

Posted by Evan Bleicher on 21-May-2012 08:11

The OpenEdge JSON API provided in the language utilizes a 3rd party package for some processing.  The JSON framework written by OpenEdge development does not take advantage of multi-threading.  Additional research needs to be done to determine if any facilities we used took utilized multi-threading - our expectation was that they also do not.

If you have a code sample which reproduces this behavior, please submit it with Technical Support, so that we can look into this issue.

Evan

Posted by Shelley Chase on 21-May-2012 09:11

Hi Julian,

Just a shot in the dark but can you try fully qualifying the class name everywhere. I want to rule out that the compiler got confused on resolving the classname.

JsonObjectModel1 = new ObjectModelParser().
becomes

JsonObjectModel1 = new Progress.Json.ObjectModelParser().

etc...

Thanks

-Shelley

Posted by jmls on 21-May-2012 10:06

it was any json data

Posted by jmls on 21-May-2012 10:11

I'll see if I can reproduce this outside the application

Posted by jmls on 21-May-2012 10:11

Yeah, I would try that, but I've since recompiled and (of course) the

damned thing is now working.

Would it be useful for you to have the protrace files if I still have them ?

Posted by Evan Bleicher on 22-May-2012 08:10

Hi Julian:

If you have the protrace files, you can send them to me (bleicher@progress.com).  Without a reproducible test case, this will probably not shed any light on what was occurring prior to your recompilation.

Evan

Posted by jmls on 03-Jun-2014 13:07

man, I've just started hitting this again :( 11.3

will try and get the reports / data

This thread is closed