Subject | Re: [Firebird-Java] TPB getAttribute neither as int or String! |
---|---|
Author | Roman Rokytskyy |
Post date | 2006-01-17T23:15:33Z |
> I've been trying to understand TransactionParameterBuffer, so I simplyNobody needed it before. :)
> tried to print out its contents (btw, it would be VERY nice to be able to
> do this without getting every parameter - is there a reason why
> getArgumentsList() is private?).
> however, I can't seem to get some of the attributes, either as an int orProbably I have chosen wrong method names - in fact there are three methods
> as a String, the only 2 methods available. eg
to get value as
a) int - getArgumentAsInt
b) String - getArgumentAsString
c) boolean - hasArgument
Last method does not throw exception also for int and String attributes, but
the rest of the behavior is correct - you cannot get boolean attribute as
int or as String.
> Also, can someone explain how I set different attributes, and which onesIn general it corresponds to the definition in InterBase 6.0 API Guide
> need which addArgument(...) method? I couldn't find it anywhere in the
> docs or in the source.
(currently the only documentation).
- addArgument(int) - for booleans (in API Guide described with length 1 and
value ignored);
- addArgment(int, int) - for integers (not applicable for TPBs, copied from
the DPB)
- addArgument(int, String) - for strings (for TPBs needed only for table
reservation, but also same method used for DPBs)
- addArgument(int, byte[]) - set byte data to send over the wire directly
(use only if you know what you're doing).
> txSettings.addArgument(TransactionParameterBuffer.CONSISTENCY);You were not supposed to read it. I hardly can imagine application that
>
> but then couldn't read it as either Int or String.
needs to access the data DPB or TPB that was set in other part of the
application. But since you've asked, I think we have to add this feature.
> This is very confusing!Thanks for the report - we will extend the interface to allow also reading
without confusing too much :-)
Roman