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: Exception Names
    ... Tom Anderson wrote: ... One would venture to say that one nearly always reaches the end of a stream, ... Generally I see little rhyme or reason as to why some occurrences in Java are handled with return values and others with exceptions. ... For example, there's nothing exceptional about not finding a file or trying to write to a read-only file, and yet we've got FileNotFoundException. ...
    (comp.lang.java.programmer)
  • Re: Exception Names
    ... One would venture to say that one nearly always reaches the end of a stream, ... Generally I see little rhyme or reason as to why some occurrences in Java are handled with return values and others with exceptions. ...
    (comp.lang.java.programmer)
  • 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: Exception Names
    ... -1 at the end of a stream. ... It may bee goofy but it is very likely to be a whole lot faster. ... for (char c: stream) ... You have to wrap the exceptions with RuntimeExceptions. ...
    (comp.lang.java.programmer)