In message <[EMAIL PROTECTED]>, Rickard �berg
<[EMAIL PROTECTED]> writes
>Hey
>
>Justin Forder wrote:
>> When I run my (trivial) JAWS CMP bean against InstantDB, I get a useful
>> trace of the SQL being executed in trace.log.
>> 
>> The same code run against Hypersonic SQL writes nothing to trace.log.
>> 
>> Why is this? Can I change it? Where should I look in the source to
>> understand what is going on (there are peculiarities in the trace that I
>> need to get to the bottom of)?
>
>trace.log is a InstantDB specific log, written by InstantDB. Hence there
>is no equivalent for any of the other DB's, unless they themselves
>provide such logs.

That makes sense. It is showing the view from "the other side of JDBC",
where PreparedStatements have had their parameters plugged in. The
peculiarities I mentioned are that literal strings are not being quoted.

The statements are working, though, so the log is perhaps not quite
faithful to what is really happening.

I'll look into this further, and take it up with Peter Hearty (InstantDB
author) if need be.

>It would be possible to add this kind of logging to the JAWS module
>however. It seems like a pretty useful thing to have.

The server.log shows what PreparedStatements are being executed, but
doesn't show their parameters. Adding the parameters to the log records
would make a big difference.

By the way, are you aware of any problem that would cause JAWS CMP code
to work against HypersonicSQL, but fail due to NULL ids in SQL
statements with InstantDB?

Here's a log (you may recognise Sun's Product CMP example):

Thread-213 CREATE TABLE Product (description VARCHAR(256),price
DOUBLE,productId VARCHAR(256))
RMI TCP Connection(6)-127.0.0.1 INSERT INTO Product ( description ,
price , productId ) VALUES ( Ceramic Dog , 10.0 , 123 )
RMI TCP Connection(6)-127.0.0.1 SELECT description , price , productId
FROM Product WHERE productId = 123
RMI TCP Connection(6)-127.0.0.1 UPDATE Product SET price = 123 WHERE
productId = NULL
RMI TCP Connection(6)-127.0.0.1 java.lang.NullPointerException: 

Aha! The UPDATE statement is getting the ID in the price parameter, and
has nothing left to plug into the productId parameter. Why would this
differ between InstantDB and Hypersonic?
-- 
Justin Forder


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to