On 2/13/07, Tor Hildrum <[EMAIL PROTECTED]> wrote:
> Ok, I made all the changes suggested but it still wasn't as fast as I
> expected it to be.
>
> I tried changing from SQLite to MySQL and the whole function is down
> to a few microseconds. So, I'm guessing part of the problem was due to
> SQLite. Probably should
> have checked that first.

I did some more benchmarking with SQLite, and here is what I've found:
The code:
---------------------
log.debug("Start!")
        timing.start()
        tmp[i].loaner = User.get(loan.loanerID)
        timing.finish()
        log.debug(timing.milli())
        log.debug("END!")
---------------------

The SQL:
---------------------
2007-02-13 16:31:06,039 inventar.controllers DEBUG Start!
 1/Query   :  UPDATE loan SET loaner_id = (1) WHERE id = (14)
 1/QueryR  :  UPDATE loan SET loaner_id = (1) WHERE id = (14)
 1/COMMIT  :  auto
2007-02-13 16:31:06,320 inventar.controllers DEBUG 280
2007-02-13 16:31:06,321 inventar.controllers DEBUG END!
---------------------

So, it looks like it's trying to update a field in the database that
doesn't exist, which isn't what I want. Fixed it by not trying to add
data to my SelectResult :)

Now it looks like this:
----------------------------------------
2007-02-13 16:40:29,851 inventar.controllers DEBUG Start!
 1/QueryOne:  SELECT user_name, email_address, display_name, password,
created FROM tg_user WHERE id = (14)
 1/QueryR  :  SELECT user_name, email_address, display_name, password,
created FROM tg_user WHERE id = (14)
 1/COMMIT  :  auto
2007-02-13 16:40:29,853 inventar.controllers DEBUG 1
2007-02-13 16:40:29,854 inventar.controllers DEBUG END!
----------------------------------------

Which is perfect :)

Tor

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to