Monday, May 11, 2009

Adding attachment to CouchDB's document

CouchDB can be attached some file toward document from 0.9.0.The previous version could make inline attachment,and last version could make some attachment standalone.

So I tested like this:
$curl -X PUT http://hostname/database/document/test.txt?rev=nnn -H "Content-Type: text/plain" -d @test.txt

And this,too:
$curl -X PUT http://hostname/database/document/test.jpg?rev=nnn -H "Content-Type: image/jpeg" --data-binary @test.jpg

That's useful function.I'd like to image&create some cool service using CouchDB.Actually,I had mistake that I couldn't update jpeg file cause of my wrong settings.So I emailed my trouble to offcial mailing list,and I got correct settings.I didn't know "--data-binary" description.The man who answered my question was so kind !!

Saturday, April 11, 2009

Club DB2 at Shinagawa

I joined Club DB2 last night.The theme was "lock basics" about DB2.I could re-check it.I love this Club (and other workshop,meeting...) because we can concentrate technical terms without treating  terribble things,for instance boss,team,management,and so on.We can be pure toward technical terms !!

What I like about DB2 lock system is to have hard lock mechanism.For example,a application must wait to refer the data row while other application is updateting the same row.If the time set LOCKTIMEOUT parameter is filled during waiting update,a application have to be aborted.Some developpers hate this supecification.But I think it's nature,is needed for DBMS.So I feel strange oracle provide previous row if application need to select data which is being updated.On the other hand,I know oracle"s lock system has a merit that give aplpications and developpers powerful concurrency.

The best way is to understand the lock system differences among databases.