Re: Exceptions and Streams



"REH" <spamjunk@xxxxxxxxxxx> writes:

1) Does 11.4.1 (16) of the RM (see below) say that I can stream an
exception occurrance to another address space and re-raise it? Note
that I am not using "partitions" as defined in the Distributed Ada
Annex, but just separate address spaces.

I have certainly had trouble streaming ::something to do with
exceptions:: with GNAT, but I'm afraid I can't remember what. The
symptom was an endless recursion, I think. Not much help, I know.

One thought: with 'gnatbind -E', GNAT keeps a traceback in the
occurence, but it's in terms of addresses so may not make a lot of
sense in another address space. This can also cause confusion in
exceptions raised during rendezvous if the traceback is reported from
the caller's point of view!

2) Is there an easy way to determine the number of elements an
object of a given type will write to a stream before hand? I need
to know how big to make the array to hold all a procedures
parameters, and I don't want to have to hard-code things like dupe
vector sizes.

You might find it easier to create a stream which could extend itself
on overflow?

I found 'Max_Size_In_Storage_Elements + 128 worked well (the streamed
version will very likely be smaller than 'Max_Size.., plus something
for the constraints).
.



Relevant Pages

  • Re: SqlXml MemoryStream Bulk Load Errors
    ... It explains how to create a wrappper Stream that will make Bulkload work ... > CreateStreamOnHGlobal(0, true, out dataStream); ... > //Catch all SQL XML Bulk Load API Exceptions ... > public MemoryStream SqlXmlMemoryStream ...
    (microsoft.public.sqlserver.xml)
  • Re: Exceptions and Streams
    ... I have certainly had trouble streaming::something to do with ... exceptions:: with GNAT, but I'm afraid I can't remember what. ... with 'gnatbind -E', GNAT keeps a traceback in the ...
    (comp.lang.ada)
  • Re: ObjectInputStream und readObject
    ... feststellen kann, ob Du ein Objekt in den Stream geschrieben hast, dann ... wirst Du kaum einen anderen Weg finden. ... Die Exceptions wirst Du eh ... irgendwie handhaben müssen. ...
    (de.comp.lang.java)
  • Re: ObjectInputStream und readObject
    ... feststellen kann, ob Du ein Objekt in den Stream geschrieben hast, dann ... Die Exceptions wirst Du eh ... irgendwie handhaben müssen. ... Ich dachte es gibt einen anderen Weg, außer eine Exception werfen zu lassen. ...
    (de.comp.lang.java)
  • StreamWriter closes MemoryStream???
    ... I've noticed that after calling the Close method on a StreamWriter, ... exceptions on any operation I might request on the associated stream (with a ... message "Cannot access a closed Stream"). ...
    (microsoft.public.dotnet.general)