Is this a bug?

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


Hi Sai-Lai,

I have written an object which have this method:

void  openConnection(in string dbName) raises(BadConnection);

where BadConnection is simply:
exception BadConnection { };

the ID of this exception is "IDL:SQLBroker/BadConnection:1.0" which is 32
byte long (SQLBroker is the name of the interface).

But in the method 
CORBA::Boolean _sk_SQLBroker::dispatch
in the sqlBrokerSK.cc file

generated by the IDL compiler I found (line 916):
_s.put_char_array((CORBA::Char *)SQLBroker_BadConnection_IntfRepoID,35);

With this value (35) the java client doesn't recognize the exception as a
BadConnection exception, because of the 3 undefined bytes in the ID
string.

Changing line 911 of sqlBrokerSK.cc with
_msgsize += 36;

line 914 with:
CORBA::ULong _len = 32;

and finally line 916 with:
_s.put_char_array((CORBA::Char *)SQLBroker_BadConnection_IntfRepoID,32);

everything works fine!

the complete definition of the interface is:
---------------------------------------
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;
};
------------------------------------------------------
Is this a bug, or am I doing something wrong?

Best regards,
Stefano.