Is this a bug?

Nalin Stefano 308885/IF tikki@dei.unipd.it
Mon, 20 Oct 1997 11:35:28 +0200 (MET DST)


Hi Sai-Lai,

I have the following interface:

----------------------------------------------
typedef sequence<string> StringSeq;
typedef sequence<StringSeq> Table;

interface SQLBroker {
  
  exception BadConnection { };

  void      openConnection(in string dbName) raises(BadConnection);
  string    execQuery(in string mesg);
  void      closeConnection();
  string    readItem(in long row, in long col);
  StringSeq readRow(in long row);
  Table     readAll();
  string    fieldName(in long fieldIndex);
  string    fieldType(in long fieldIndex);
  long      fieldSize(in long fieldIndex);

  readonly  attribute long nRows;
  readonly  attribute long nColumns;
};
---------------------------------------------------

The ID of the exception is: "IDL:SQLBroker/BadConnection:1.0", which is 32
byte long.

In the file sqlbrokerSK.cc (generated by omniidl2), I have found:

line 911: _msgsize += 39;
line 914: CORBA::ULong _len = 35;
line 916: _s.put_char_array((CORBA::Char*) 
             SQLBroker_BadConnection_IntfRepoID,35);

With these values the java client doesn't recognize the exception as a
BadConnection exception, because of the 3 undefined bytes in the ID
string.

Changing the 3 lines above with: 

_msgsize += 36;

CORBA::ULong _len = 32;

and

_s.put_char_array((CORBA::Char *)SQLBroker_BadConnection_IntfRepoID,32);

everything works fine.

Is this a bug, or am I doing something wrong?

Best regards,
Stefano