[ 
https://issues.apache.org/jira/browse/UIMA-6295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17243545#comment-17243545
 ] 

Richard Eckart de Castilho commented on UIMA-6295:
--------------------------------------------------

A second option that seems to work would be introducing a tracker set 
{{uimaSerializableSavedToCas}}, adding every FS on which 
{{_save_to_cas_data()}} has already been called to that set and before actually 
calling {{_save_to_cas_data()}} on an FS, checking if it is already part of the 
set. That way we can also ensure that {{_save_to_cas_data()}} is not called 
twice. We wouldn't have to comment the line out which might have unforeseen 
side-effects. We use a bit more memory and processing power during 
serialization to keep track of the extra information, but we can use the 
{{PositiveIntSet_impl}} which is optimized for being used as a FeatureStructure 
index to do that to keep the impact minimal. The benefit with this tracking 
approach is also that the {{_save_to_cas_data()}} can remain the same as you 
provided (i.e. without the re-using the FSArray optimization that I did above).

> CAS transportable Java object not serialised or deserialised with compressed 
> binary
> -----------------------------------------------------------------------------------
>
>                 Key: UIMA-6295
>                 URL: https://issues.apache.org/jira/browse/UIMA-6295
>             Project: UIMA
>          Issue Type: Bug
>          Components: uimaj
>    Affects Versions: 3.1.1SDK
>         Environment: [^cas-transported-java-objects.zip]
>            Reporter: Mario Juric
>            Priority: Major
>         Attachments: cas-transported-java-objects.zip
>
>
> I have been experimenting with wrapping a CAS transportable Java HashMap 
> inside an UIMA type, and I found that the internal UIMA FSArray is either not 
> stored or restored, although _save_to_cas_data and _init_from_cas_data of 
> UimaSerializableFSs are called during serialisation and deserialisation of a 
> compressed CAS binary. I have not yet been able to pinpoint where it goes 
> wrong, serialisation or deserialisation, but I attached a simple Maven 
> project with a test that reproduces the problem. Notice that the test that 
> uses XMI succeeds, while the one that uses 
> SerialFormat.COMPRESSED_FILTERED_TS fails.
> [^cas-transported-java-objects.zip]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to