public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException
{
super.readExternal(in);
specificName = (String) in.readObject();
dynamicResultSets = in.readInt();
parameterCount =
in.readInt();
parameterStyle = in.readShort();
sqlAllowed = in.readShort();
returnType = (TypeDescriptor) in.readObject();
calledOnNullInput = in.readBoolean();
int readMoreFromDisk = in.readInt(); //This will be 0 from
pre-10.2 db
if (parameterCount != 0) {
parameterNames = new String[parameterCount];
parameterTypes = new TypeDescriptor[parameterCount];
ArrayUtil.readArrayItems(in, parameterNames);
ArrayUtil.readArrayItems(in, parameterTypes);
parameterModes = ArrayUtil.readIntArray(in);
} else {
parameterNames = null;
parameterTypes = null;
parameterModes = null;
}
if (readMoreFromDisk == 1)
//If true, that means we are dealing with 10.2 db and hence
//we should read external security info from the disk
executeUsingPermissionsOfRoutineInvoker = in.readBoolean
();
else
//We are dealing with pre-10.2 db, which doesn't have external
//security feature on routines and hence no information about
//external security will be found on the disk
executeUsingPermissionsOfRoutineInvoker = true;
in.readInt(); //future expansion for post 10.2 release
}
/**
* Write this object to a stream of stored objects.
*
* @param out write bytes here.
*
* @exception IOException thrown on error
*/
public void writeExternal( ObjectOutput out )
throws IOException
{
super.writeExternal(out);
out.writeObject(specificName);
out.writeInt(dynamicResultSets);
out.writeInt(parameterCount);
out.writeShort(parameterStyle);
out.writeShort
(sqlAllowed);
out.writeObject(returnType);
out.writeBoolean(calledOnNullInput);
out.writeInt(1); // 1 means we are dealing with 10.2 on disk format
if (parameterCount != 0) {
ArrayUtil.writeArrayItems
(out, parameterNames);
ArrayUtil.writeArrayItems(out, parameterTypes);
ArrayUtil.writeIntArray(out, parameterModes);
}
out.writeBoolean(executeUsingPermissionsOfRoutineInvoker);
out.writeInt(0); //future expansion for post
10.2 releases
}
Hi,Dan, could you expand a little more on"The RoutineAliasInfo has the correct structure to support expansion. It
writes out an unused value, set at 0. This could be bumped to indicate
that more data needs to be read, e.g. 1 means the external security info
flag is written to disk etc. etc"?What I am looking for is what happens during upgrade if I add another field to RoutineAliasInfo(since this change will become part of SYSALIASES AliasInfo field)? I am not sure if it is as easy as just changing the RoutineAliasInfo class and everything will work fine, especially during an upgrade.Also, looking at Derby-337 (dblook doesn't generate SQL statements for SQL functions.), it seems like Army had encountered some problems when he had to add a filed to RoutineAliasInfo.Any thoughts on this will be helpful,Mamta
On 2/22/06, Daniel John Debrunner <[EMAIL PROTECTED] > wrote:Satheesh Bandaram wrote:
>
> Mamta Satoor wrote:
>
>> Satheesh, I was looking through the code last night and saw following
>> comment, about external security info flag, in CreateAliasNode.init
>> line 195
>> // GrantRevoke TODO: Figure out how to save external security
>> info. Putting this in
>> // RoutineAliasInfo may not be the best long term solution
>> It seems like RoutineAliasInfo will be the logical place to keep this
>> external security information, similar to the way we keep other
>> information like called on null input, parameter count etc. Did you
>> have reservations about this approach because we want to move away
>> from using objects in the system tables (which in this case is
>> AliasInfo in SYSALIASES table)?
>
> Here are some of my concerns about adding another field to
> RoutineAliasInfo.
>
> 1. It would become harder to extract this info from RoutineAliasInfo
> as it is a Java object for any metadata processing... like in
> dblook or for other GUI tools. We would have to document how
> RoutineAliasInfo gets generated as a character type and maintain
> that format in the future.
> 2. Have to support existing RoutineAliasInfo instances created in
> existing databases. You would have to introduce a new
> RoutineAliasInfo version or add a new mapping to another java object.
The RoutineAliasInfo has the correct structure to support expansion. It
writes out an unused value, set at 0. This could be bumped to indicate
that more data needs to be read, e.g. 1 means the external security info
flag is written to disk etc. etc.
Dan.
