Blobs and Power

Matts on 2005-12-02T17:39:56

Having just released DBD::SQLite 1.10 to CPAN I'm about to upload 1.11 to update it. After some interesting discussion on the SQLite mailing list about blobs and how DBD::SQLite handles them it turns out there's a simple way for me to support blobs without needing for users to resort to the current contortions. So now blobs will just work transparently (with a caveat in the docs about string lengths using the SQL length() function when you don't insert explicitly as a blob).

The other thing that has happened to me lately is a huge amount of frustration with my internet connection. I thought this was a problem with Bell, as they are having major problems at their end (presumably due to over subscription - but I don't really know). However after finally doing some debugging today I discovered what was wrong...

It seemed odd to me that Heather hadn't been complaining of any problems. So I wondered if the problem was localised. Pinging my DSL modem I discovered I was getting about 70% packet loss. Very strange. I tried to reboot everything - my computer, the modem, and the Airport Express. No help. So I puzzled for a bit over this. What had changed?

Well a week or so ago I bought myself a really cheap USB2 hub. Really cheap in that it isn't a powered device (though it has a power socket - it doesn't require power). You probably know what is coming now.

Turns out this little USB device must have been taking power from the airport card, and although the signal strength looked just fine on the screen, it must have been causing it to fail in mysterious ways.

I've unplugged it now, and I'll try and find power for it, but for now all is well.


Great work on the BLOBs! Next...

Alias on 2005-12-03T05:11:22

Neato, simple BLOB support is one of two things I've been waiting for to add SQLite to a system of mine.

Maybe you can start thinking about the other one.... sequences.

The big problem with sequences is that they need to happen outside of any transactions. With MySQL, you can emulate sequences quite nicely (DBIx::MySQLSeqence) by using a different connection and that way keep it out of transactions (sequences can NEVER be allowed to rollback).

Except I _think_ that concurrency issues in SQLite make that solution impossible. You can only lock the entire database at once right?

So if you need to fetch a sequence in the middle of a transaction, you can't just use another connection because it can't increment the sequence until the transaction ends...

Now, one answer is to add a second SQLite database, but that really really complicates things and what might work as a one-off hack in a single case doesn't really generalise at all well.

So any thoughts?

Re:Great work on the BLOBs! Next...

Matts on 2005-12-03T13:42:03

You'd have to use a separate database :-)

I don't understand why sequences can't get rolled back though. Perhaps this is something to discuss on the sqlite list?

UTF-8

Dom2 on 2005-12-03T09:05:55

Thanks for the UTF-8 support -- Checking that existed was on my todo list for Monday!

Now I just need to try and get a similiar patch into DBD::mysql as well...

-Dom