Wednesday, October 03, 2007

How to change the host and port for Java DB server in NetBeans

This issue has come up a number of times on the mailing list, so I thought I'd post it here for posterity.

The question is: how do you configure the Java DB Network Server, like set its host and port number, for the server that NetBeans starts and stops for you?

The sad answer is: you can't from the IDE. There is a bug logged for this.

However, you can do this by editing the derby.properties file.

First, find out where your database directory is. In NetBeans 6, go to Tools->Java DB Database->Settings and see the value for Database Location

For NetBeans 5.5, go to the Preferences/Options panel for NetBeans, choose Advanced Options, and then under IDE Configuration->Server and External Tools Settings->Java DB Database look at Database Location.

Under that directory, edit derby.properties. The file should be there; if it's not, create it.

Then add

# Change host setting so you will accept connections from any host
derby.drda.host=0.0.0.0

# Change port number if you don't want to use the default of 1527
derby.drda.portNumber=8080

Then for both NetBeans 5.5 and NetBeans 6, do Tools->Java DB Database->Stop Server and then Start Server.

The new properties should now be applied.

Friday, September 28, 2007

Google Search is Down

Well, some things you always take for granted. In the six-plus years I've used Google Search, it's never been down, but for the past ten minutes http://www.google.com is not responding. Thinking about how many layers of redundancy they must have, I can only imagine what nightmare of cascading failures caused this.

Update: Google Reader appears to be affected too, I get nothing but the page header...

Wednesday, September 26, 2007

Why programmers hate relational databases: Greg Jorgensen

Greg Jorgensen writes a fun blog about the common complaints programmers have against relational databases and his responses to them.

Most professional programmers know how it feels to see an amateur, unfamiliar with Knuth or any programming book containing equations, implement their own sort routine. That’s how people who understand relational theory feel when they see a badly-designed database. Relational theory and RDBMSs are old and well-established now, so it’s hard not to think a lot of programmers are willfully ignorant.

I have seen this too: "I don't need a friggin' relational db, just give me a flat file." Sometimes this works, but all too often I see the same programmers adding locking semantics, querying capabilities, indexes, and so on, and I just shake my head.


Rails and JPA (Instead of ActiveRecord) : Brian Leonard gives it a go

I have been seeing some blogs complaining about ActiveRecord and its limitations. I don't know ActiveRecord and what users need from it well enough to know if these are valid complaints, but Brian Leonard shows a possible alternative: JPA with JRuby.

Tuesday, September 25, 2007

Whoa! WiFi on the bus!

I was just sitting here working offline on my bus ride from the Union City BART to the Sun Menlo Park campus as I normally do when I noticed the guy in front of me looking at the BART schedule on his laptop.

I looked for some fancy schmancy network card in his PCMCIA slot, but nothing there. Then I thought, what the heck, and what do you know, and I looked for wifi signals. What do you know, there was an ssid called ac_transit_wifi_bus.

Whoee! It's a nice fast signal too. So here I am zooming across the Dumbarton Bridge and able to work online.


View Larger Map

Now if they could only get it on BART, I'd be a very happy camper.

Monday, September 24, 2007

Including images in your blogs

By the letter of the law, any original created work is copyrighted, even if it doesn't say so. That includes both text and images.

So that means that if you include an image in your blog, you are copying it, and you have to have rights.

Note that putting in a link to an image can be interpreted as copying, and even if it isn't, some people don't like it; it can also be a big impact on the hosting site for the image, see Tim Bray's blog about this.

Many Dear Readers probably already knew about this, but there is an entire site called the Wikimedia Commons which dedicated to media that you can safely copy, normally licensed under GPL or Creative Commons. The other thing I do is use Flickr, and search for images that have the right Creative Commons license.

By the way, if you ever want to include some of my Flickr images, go right ahead, I've licensed them using basic "Attribution Creative Commons" -- all you need to do is include an attribution when you include. Although I don't know why you'd want to include pictures of my baby son or grainy pictures of Prague.

Google Gears coming for GMail

We knew it had to happen, and here it comes. GMail may soon have offline support. I tried offline support with Google Reader and was underwhelmed - pretty buggy and a bit confusing. I hope they do a better job with GMail.

http://blogs.zdnet.com/Google/?p=750&tag=nl.e622

Friday, September 21, 2007

Quoting SQL - begone!

We recently put in a few changes to the database support for NetBeans that I thought you might like to know about.

A very common complaint has been the fact that NetBeans quotes everything when it comes to SQL. When you use the Database Explorer to create a table, index, view, etc., it quotes all the identifiers.

This may or may not be an issue. If, for example, you use all upper case for your identifiers, and the database you are using follows the standard and auto-upper-cases all identifiers, then if you write SQL without quoting, things will work. But how many of us bother to consistently upper-case things?

Here's what can happen to you in NetBeans 5.5:

NB55-Create-Table.jpg

Broken-Select.jpg

Well, as of Beta 1, we don't do that any more. We do not quote identifiers when creating SQL objects. If you want them quoted, you can do so when you type in the identifier in the wizard. So now you get the right behavior:

NB6-create-table.jpg

NB6-select-table.jpg

When Beta 2 comes out, we have also made it so that when we generate SQL for you (for instance, when you choose "View Data" on a table, or when you us the visual query editor), we only quote when needed, whereas before we quoted every identifier, whether it was needed or not, misleading users to think they also needed to quote everything, and making the SQL difficult to read.

So, for all of you who have been complaining to me and others on our team about this: you're welcome. Chocolates are always appreciated :)

Sun surprises at RailsConf Europe 2007

David Heinnemeir Hansson (inventor of Rails) is actually starting to believe Sun is serious about Ruby and Rails. Great work, Craig! David's right about the mystery man with the cat too :)

http://www.loudthinking.com/posts/11-sun-surprises-at-railsconf-europe-2007

Reddit thread on session state

My blog on session state was picked up by a Reddit reader, and hit the top five in the programming subtopic. I discovered this when I saw the hit count on my blog go from a cozy average of 50+ to 1,500. Yow!



There have been some interesting comments, and together I believe they give a richer view of the topic that may help you make a more informed decision around the whole matter.

Tuesday, September 18, 2007

Session State is Evil

As I mentioned in a previous post, I was responsible for architecting a clustered version of Sun's app server using HADB, a highly available, highly scalable database. Why did their clustered version need a scalable database? For one specific reason: session state.

One of the things that really sucked with the previous version of the app server was that their session state replication mechanism was completely broken. It would corrupt data or get into deadlocks, and couldn't scale beyond three or four nodes.

This was my first exposure to the demands of session state and how it impacts the back-end architecture. HADB is attractive because it, basically, never goes down, and it is transactional, so it would solve the reliability and scalability problems of the previous implementation.

The more I learned about session state, the more I disliked it. The impact to a system trying to be scalable and available was enormous.

First of all, load balancers have to be able to detect the session id and make sure that a request for an existing session was routed back to the same instance. Only certain hardware load balancers know how to do this, and it requires digging into the HTTP message to pull out a special cookie that tells you what instance owns the session.

Secondly, application servers have to be able to handle all this session state without using up all the memory of the system. So EJB invented this marvelously ugly word, "passivation", by which session state is written out to disk and dropped out of memory - in other words, a virtual memory system for session state.

And then there is the impact on the complexity and scalability of clustered systems. Because you never know when a given instance may go down, session state has to be relocatable to any other instance in the cluster. Trying to build something that does this correctly is complex, painful, error-prone, and, to be honest, annoying.

For the end users, you end up with systems that are always limited in some way or another. If you store session state in a shared database, this impacts response time, and this database is another moving part you have to administer. And it had better be highly available and scalable otherwise it can only handle so many instances -- ultimately the database itself impacts scalability.

If you use in-memory replication, then either you have to make the state available to all instances, which means lots and lots of data flying around the network, constraining scalability, or you have to pair up instances. This is dangerous, because if one instance goes down, the other instance has to handle all the workload of the existing sessions of the downed instance -- you end up with hot spots and if you're not careful, a wonderful cascading failure scenario.

There is a giant sucking sound of processing power, time, money, and intellectual resources being used up on this problem, all because someone wants to store a shopping cart in HttpSession.

All of which leads me to conclude: session state is evil.

When I read about the principles of REST, I was really taken by it. One principle that really stood out for me was: stateless. HTTP was never meant to be stateful, and for good reason. Imposing state on this protocol is a bastardization of its original intent.

Rather than share my potentially confused view of this, I'll quote Roy Fielding[1] directly from his slides on REST that he gave at RailsConf:
  • A successful response indicates (or contains) a current representation of the state of the identified resource; the resource remains hidden behind the server interface.
  • Some representations contain links to potential next application states, including direction on how to transition to those states when a transition is selected.
  • Each steady-state (Web page) embodies the current application state -- simple, visible, scalable, reliable, reusable, and cacheable network-based applications
  • All application state (not resource state) is kept on client
  • All shared state (not session state) is kept on origin server
Do you get it? I repeat: all application state is kept on the client.

So stop asking the server to "hold on to things" for you. Please. If you do that one simple thing when you build an application architecture, you have freed the server infrastructure; you have given it wings.

Today it is easier than ever before to do this. With AJAX and RIA toolkits like JavaFX (shameless plug), you can provide dynamic interaction with the user without having to ping the server all the time and have it store conversational state. You can even use Java DB or Google Gears to keep your client-side state persistent.

Because of these new web client technologies and patterns, I don't believe the concerns that saving state on the client necessarily results in more network traffic. You change your interaction with your server from lots of little requests with little bits of data to much less frequent requests with more data. In general, because of the overhead of a network request, I believe this is a Good Thing.

So, I know it's tempting to use session state. I know it seems easy at first. I know that all the server products out there give you utilities to do it and talk it up (they're even talking about letting you keep even more state around). But Just Say No. Don't Do It.

I have seen where it takes you, and it ain't pretty.


[1] I have a funny story about the first time I met Roy Fielding. I was at the Derby booth at ApacheCon, and Roy had come over to learn more about it. I didn't know him from Adam, and I asked him why he was interested. He said he was starting a new project in Apache to do document management.

I said with a big smile "welcome to Apache!". He looked at me for a second and said, "well, actually, I've been around Apache for many years..."

It was only later that I discovered that he was one of the founders and is currently a VP at Apache :)

ServerSide: Hooray for Glassfish and NetBeans

Some impressively positive comments about Glassfish and NetBeans. I've seen some of the heat that can come from this forum -- this is no "inside" marketing job, this is the real thing.

http://www.theserverside.com/news/thread.tss?thread_id=46923

I.B.M. to Offer Lotus Symphony free, based on Open Office

"I.B.M. declared that it was formally joining the open-source group [OpenOffice], had dedicated 35 full-time programmers to the project and would contribute code to the initiative." This is a serious boost to Open Office.

http://www.nytimes.com/2007/09/18/technology/18blue.html?ex=1347768000&en=964b86e1c626bd78&ei=5088&partner=rssnyt&emc=rss

5 Green Cars Coming Out of the Frankfurt Autoshow

Earth2Tech has the rundown on some interesting new eco-friendly cars showing up at the Frankfurt Auto Show

http://earth2tech.com/2007/09/09/5-green-cars-coming-out-of-the-frankfurt-autoshow/

Rice puddin' for the Elephant-God

A very sweet (literally) post from Manju. I really like Manju's blogs, they always leave a smile on my face. Now I want to try his recipe for rice pudding.

http://blogs.sun.com/bio/entry/lunch_with_my_elephant_god

Monday, September 17, 2007

From chaos to Glassfish v2: you've come a long way baby


Glassfish Version 2 is out. And what a release it is.

The first release was focused on single instance deployments and developers. This release throws in the works. It has the features you need to run this puppy in an enterprise environment: clustering and HA (including a new in-memory replication feature using JXTA), serious administration and console, record-setting performance, all in a single all-in-one 50+MB bundle rather than confusing users with three separate versions.

I think it's worth looking at how far this team has come and what they have accomplished by looking at a little history (from the biased perspective of yours truly :)).

When I first joined Sun, I was part of Clustra, which became the Database Technology Group here at Sun. We came with a modest little 5-9s highly available, highly scalable RDBMS that was named HADB (Highly Available Database).

I was asked to architect a clustered version of the app server that used HADB as the session store, so I was working very closely with the app server team.

At this time the team was in the middle of completely redoing the app server to move away from the basically overwhelmed and broken C/C++-based codebase inherited from, if I recall, three different app server acquisitions: Netscape, Kivasoft, and NetDynamics.

They were redoing everything by taking a copy of the Reference Implemention, built in 100% Java, and making it "production grade" in terms of features and performance.

It was a difficult and ugly time. The two teams (RI from old Javasoft and the Netscape/Kiva/AOL/you-name-it team) were not getting along very well, and emotions were high. We used to call the Java team "Church" because they were such sticklers for compliance and elegance and we called the production team "State" because they just wanted to get something that customers wanted, that performed, and that was delivered on time.

The processes in place at the time were, well, shocking. They regularly could not get a build to work, and the performance was getting regularly worse instead of better. The product was months late and we had nightly pow-wows with executives to track a dashboard where most of the line-items were red.

I remember trying to get a copy of the codeline and build it. But things were so non-open-source that you had to be on a machine within the Sun network that could auto-mount the necessary drives that contained supporting binaries and infrastructure. In other words, given that I worked from home, I couldn't build it on my machine, and I couldn't find a machine that anybody would give me access to that had these mounts. Pulling down the cvs tree took hours, and then my attempts to build got regular failures. I finally gave up.

After a year, I moved on, and started working on Apache Derby. I have to admit it was a relief...

Since then, I have watched with joy and amazement what the app server team has done.

I have watched them go through the painful process of merging the two codelines (RI and Sun Java Application Server based on the RI) and merging the two teams.

I remember them making the bold decision to take this massive code base and open source it, even though there was already a market-leading open source implementation (JBoss).

I saw them use their blood, sweat and tears to deliver an implementation of Java EE 5 immediately after the release of the spec.

And I started noticing incredible improvements. Getting and using Glassfish has become easier and easier. Today I can just download the bits, put it in a directory, run a simple install script, and voila, everything works. I started hearing users and reading blogs saying, basically, "hey, this ain't half bad. As a matter of fact, it's pretty cool!"

I started feeling proud of our app server.

Then I saw a demo last year of their new modular architecture (coming in version 3), with a sub-second startup time and intelligent auto-loading of modules, and I was just astonished. This was the same app server that I had worked with four years ago? That day over lunch, a Glassfish competitor sharing with me when he saw that demo, he knew that they were in serious trouble.

So, many, many kudos to the Glassfish team. You have done an incredible job, and I am proud of you.

Hilarious iPhone picture

Sent by a colleague...

Free IPhone Unlocking

Friday, September 14, 2007

Is ORM and caching ending the reign of the DBA Nazi?

Years ago, when I worked at Sybase, stored procedures were king. Sybase had introduced them, and had shown very convincingly that stored procedures gave you huge advantages, including centralized control of business rules and SQL logic, keeping the data close to the processing, the ability to compile and store the query plan for faster execution, and so on. So we all built apps that invoked stored procedures, rather than calling SQL directly.

It was also my experience that the DBAs ruled the database. They had Absolute Control, and this allowed them to fine-tune the performance of the database. In particular, they didn't let Just Anybody write SQL. That was for the masters. "Tell us what you want, and we'll write a stored procedure for you. And we'll tell you how to interact with the database. (And a box of chocolates would probably help you get it sooner)."

Just around the time I left Sybase, web applications were taking off. I didn't pay attention as much, but I noticed that more and more applications embedding SQL directly. And I wondered what happened to the mantra of stored procedures.

I have also been watching the growth of ORM technologies like JDO and JPA. And I always wondered -- how do all those DBA-zis I knew were out there in the field feel about this? I found it odd that you can't map objects to stored procedures or views, just tables. What happened to centralized control?

Well, Diego Parrilla explains where things are going , including a hilarious imagined dialog between the DBAs, an IT manager and the developer lead.

An excerpt:

IT Manager: Why this [ORM] tool writes crappy SQL?


Development Lead: It does not write poor SQL. It creates simple queries, that's all. We can configure it to create more complex SQL, but sometimes the number of objects explodes and the application run out of memory.


DBAs: Why don't you use the already created Views?


Dev Lead: We cannot map Views to objects.

DBAs: No views!? How am I going to optimize your complex queries?

Dev Lead: Well, we are not going to write complex SQL anymore. The ORM will do.


DBAs: And what about triggers and stored procedures?


Dev Lead: Out. Triggers and ORM does not match very well because it's hard to keep under control the changes performed in the DBMS. And Stored Procedures sucks, we have Java.


IT Manager: So, if there is no views, triggers and stored procedures, the DBAs can set your focus on keeping the system healthy and optimized, but not coding processes. Right?


DBAs: Errr... that's not exactly right...


IT Manager: And we can also transfer all these development tasks to the development team. Right?


I do see these kinds of debates going on the forums from time to time. An old-timer says "you have to use stored procedures to get any performance." But their claims are lost in the noise of all the people building ORM tools and working with data caches. The value of ORM and caching is too great, and stored procedures end up taking a back burner.

One fascinating conclusion Diego makes: as the business logic and data processing (through caching) goes more and more to the application server tier, then the demands on the database are less and less. Maybe it's fine to use basic, good-enough databases.

IT Manager: Should we try an open source database?
DBA: Damn Gavin King...

Hey, maybe it really is about the oil!




From my father, who regularly provides great commentary on current topics:

Today the Kurds announced that they have signed a contract with Hunt Oil Co of Texas to produce and market their oil. The idea of a national oil-sharing agreement for a united Iraq is finished. Since oil is all Iraq has got, a united Iraq is finished.

The real significance is that Mr Hunt is not only a very close personal
friend of "we are winning" Bush, but he also sits on the Council of Economic Advisors. If any businessman knows which way the wind is blowing, and what's OK with the White House, he does.

No WMD. No Saddam-Osama link. No real reason to invade Iraq. Just oil
deals for the Friends of Bush, while Dubya does the necessary fan dance.

Thursday, September 13, 2007

Daddy's got a Squeezebox!

My old Harmon Kardon died, and our birds ate through the wires of my old OmniFi music player[1], so I decided it was time to upgrade.

I don't watch TV and rarely watch movies, and I don't use, or want to use iTunes or an iPod. I mostly want to play Rhapsody music and my own collection from my stereo. Simple needs for a simple man.

Internet Audio Player

I had been dreaming for years about getting a Squeezebox.



It sounded simple, great quality, and people rave about it. The fact that their server, SlimServer, is open source, is important to me too. I know that a popular open source product is almost always better than proprietary solutions that rely on the quality of engineers from a single company.

Then when I learned that Squeezebox is now officially supporting Rhapsody (straight from the box, no need to even have a computer on), I was sold. So, I took the bonus money from last quarter (thanks, Sun!) and splurged.

Man, this thing is sweet. It is so small, cool looking, great screen, and so easy to use. The response time when I do searches and start a song are excellent. And the sound quality is very very good.

Not only does Squeezebox support Rhapsody, it also supports Pandora, and a huge selection of Internet radio stations. All from one little box.

But wait, that's not all! The SlimServer is web-based with UPnP support, so I can administer it from any browser and play it from any UPnP enabled player, like WinAmp, or from the SoftSqueeze player.

Receiver and Wireless Router

I was unhappy with my Harmon Kardon even though CNet recommended it -- too complicated and heavy and hard to use. I have decided to not read "official" reviews of hi-fi equipment because the folks doing reviews are enthusiasts and what they like is not actually what us "normal" people like. So instead I went to Amazon and read reviews from "real" people, and got a Pioneer VSX-516-K. Easy to set up, great sound, perfect. This choice had an unexpected bonus - my DVD player is a Pioneer, and the remote that came with the receiver works out of the box with my DVD player.

I also upgraded my wifi router to a Buffalo WHR-HP-G54 Wireless-G router with greater signal strength (also based on the Amazon reviews, I had never heard of this brand before), and am quite happy with that too.

NAS on the Cheap


My final issue was with how to make my music readily available to the Squeezebox. I really didn't like having to walk into the study, turn on my computer, wait for it to boot up, and log in (I have tried many times to get auto-login to work on this machine, but have failed).

So I considered upgrading, and thought seriously about a ReadyNAS system, that has SlimServer pre-installed. A lot of people really like the ReadyNAS.

But these things are pricey (around $1,100 according to Google Products), and I already had this machine and RAID set up with two 500GB disks. Why couldn't I make my machine like a NAS?

Then I read in my manual that the Squeezebox supports Wake-on-LAN. I checked my machine, and sure enough, it supported it. I configured the network card to wake the computer on a network hit, and bingo, I have, for all intents and purposes, a Squeezebox-enabled NAS system without having to fork over $1,100.

Last night I had fun just randomly picking songs from Rhapsody or my collection, basking in the experience of a well-done system and some serious sound coming from my Bose speakers. It's those little joys in life that make it worth living :)

[1] After using the OmniFi for a few years, it just didn't "have it", and I suspected that OmniFi would die, and sure enough, they've discontinued their products.

Monday, September 10, 2007

Why PostgreSQL Instead of MySQL: Comparing Reliability and Speed in 2007

An interesting and very complete analysis/comparison between PostgreSQL and MySQL. Written by PostgreSQL advocates, so take it with a grain of salt, but still a very good in-depth comparison.

http://www.postgresql.org/docs/techdocs.83

MSNBC: The quiet revolution (and my golden handcuffs): telecommuting

Sun's IWork (tele-work, flex office) program gets top billing in this MSNBC story.

I think of Sun's excellent mobile work program as one of a number of "golden handcuffs" Sun has on my wrists. That, and great pay and great benefits and great people to work with. It really is hard to beat.

Eric Redmond: Death by Overcoding: 5 Reasons Static Typing Sucks

Eric Redmond has a fun and well-written missive on why he is sick and tired of static typing. One of these days I really do need to try out Ruby. I'm getting lazy in my old age...

http://coderoshi.blogspot.com/2007/09/5-reasons-static-typing-sucks.html

Mike Stonebraker: One-size-fits-all databases don't cut it anymore

There's a new database blog, and one of the first postings is from Mike Stonebraker about how specialized databases will become more and more important...

http://www.databasecolumn.com/2007/09/one-size-fits-all.html

Salvador Dali cries wolf

A great blog with a translation of what happened to Salvador Dali when he attempted to present clad in a diving suite (to represent the unconscious). Things went awry, but nobody new it, because, he was Salvador Dali acting weird. Very very funny.

http://blogs.sun.com/bblfish/entry/authentic_paranoid_fantasies

The Central Perk - toys, coffee, and wifi



Just found a new free wifi hotspot near my home, the Central Perk. It's located right next to the newly refurbished Cerrito Speakeasy Theater.

It's spacious, quiet, good signal, good coffee. What sets this place aside is their vast, vast collection of toys. One could spend a good hour just walking around. I think I may have found a new hangout...

Friday, September 07, 2007

Sam Ruby plays with CouchDB


Sam Ruby has some things to say about CouchDB, in particular, how it has the same interface regardless of the type of client.

What API’s/drivers to I need to integrate it with Ruby?

HTTP and JSON.
What API’s/drivers would I need to integrate it with Java?

HTTP and JSON.
What API’s/drivers would I need to integrate it with AJAX?

HTTP and JSON.
What API’s/drivers would I need to integrate it with...

oh, you get my point.


Do HTTP and JSON work with existing J2EE servers? You betcha.

What tooling to I need? Um, a browser, perhaps?


What I think is interesting to note is that JDBC/ODBC/ADO.net are all APIs on top of the same protocol, too. It's just the the underlying protocol is non-standard, whereas HTTP and JSON are standard. So developers can write straight to the underlying protocol rather than needing a specific API for their particular programming environment.

Anyway, time for a second look at CouchDB. I don't know how I missed that the first time I saw it, but it has full bidirectional replication for offline support. That's nothing to be sniffed at...

Why I avoid the iPod and iPhone

More and more of my friends and family swear by the iPod. My mother even told me to get with the program. They are so nice everyone says. And many people are drooling over the iPhone.

So why don't I bite? Because the more I read about these devices and the terms and conditions around them, the more they leave a bad, metallic taste in my mouth. I don't like being locked in, I don't like signing up with a single vendor. That's why I like open source so much.

If you think it's just me whining, take a look at this article by Mike Elgan. It's looking pretty ugly.

So, you can take your shiny iPod and submit to the new Borg. Not my cup of tea.

Hotspotr - Very nice hotstpot locator

A Google Maps mashup for wireless hot spots that allows you to easily add new locations and your own ratings. Includes ratings for how easy it is to plug in your computer, which really is crucial. Nice!

http://hotspotr.com/wifi/map

Thursday, September 06, 2007

Google Reader has Search

A little note from the authors of Google Reader tipped me off to a new search box, which lets me search the feeds I'm subscribed to, both read and unread entries.

This is actually a very powerful form of focused/vertical search. I search the people and sources I value for information, rather than the Whole Web. Very simple, very nice.

ReaderSearch.jpg

Terrence Barr's Blog: Need a database with your phone?

Terrence Barr says Java DB is the answer for a compliant database for mobile platforms.

http://weblogs.java.net/blog/terrencebarr/archive/2007/09/need_a_database.html

Arun Gupta's Blog: Learn to REST using Jersey

A fully working sample from Arun Gupta showing how to use NetBeans, JPA and Jersey to build a REST-based web service with a backing database.

http://weblogs.java.net/blog/arungupta/archive/2007/09/learn_to_rest_u.html

The poor iTards feel used...

Another laugh-out-loud post from Fake Steve. I wonder if he has a day job any more...

http://fakesteve.blogspot.com/2007/09/remember-magic.html

Trimpath Junction - Synchronization between local and remote databases using JavaScript/Google Gears

I just bumped into Trimpath Junction from the Google Gears mailing list.

Trimpath is a JavaScript-based MVC framework inspired by Ruby On Rails that can run on both the client (browser) and the server (e.g. using Rhino). It also appears to allow synchronization between client- and server-side SQLite databases via Google Gears.

Pretty cool.

One interesting choice they made was to do database-level synchronization. I believe database-level synchronization has a lot of issues:
  • A service-level transaction may span multiple database transactions with multiple backend databases or services.
  • You lose the higher-level semantics of the application when you just work with the database
  • You are creating a hardcoded dependency on a particular database schema
I believe web-service-level synchronization makes more sense, but they seem to feel this is a better approach. I guess if you're tying yourself to Google Gears/SQLite on both ends it could work, but I wonder... I guess we'll have to see...

Making it easy to share on a Mac

On Windows, if you want to share a folder, you just right-click on it and choose Share.

No such luck on Mac. Very frustrating - it would appear that the only folder you can share is your home folder. Every now and then the usability folks at Apple just Get It Wrong, and this is one case (another case is their despicable Finder app, which I replaced with PathFinder and I am so much happier).

Some Googling on Mac sharing got me to a Mac Forum thread which suggested all sorts of twisty-turny configuration on the Mac, and then one quick email which said "why not just use SharePoints?".

Ah, all is goodness now...

SharePoints.jpg

Wednesday, September 05, 2007

Tip: How to See NetBeans SQL

The NetBeans Database Explorer allows you to create tables, views, indexes and so on. There may be times when you want to see what SQL it is using to accomplish these operations, or perhaps you want to save the SQL into a script for future use.

It's pretty easy to do this, but you have to know what you do. You can Enable Debug fom the top-level folder of the Database Explorer (the one called "Databases")

EnableDebug.jpg

Once you have enabled debug mode, you can perform DDL operations with NetBeans, and you will see the resulting SQL in an output window titled "Database Explorer"

AddIndex.jpg

Output.jpg

Pretty nifty!

My hovercraft is full of eels

I am just now learning that many of my favorite Monty Python skits are available on YouTube. Thank you, whoever did this!

Having just been in Prague and hoping I wasn't saying anything offensive, I remembered the great Hungarian Translation Book sketch, and then Jim Bisso pointed me to it.

A good strong laugh in the middle of the day keeps you young...

Tuesday, September 04, 2007

Voluntary means we don't have to - consumer safety in the Bush era

My Dad wrote the following to the family list today. I checked, and he's not kidding, here's the article he probably read that got him going:

http://www.nytimes.com/2007/09/02/business/02consumer.html

The quote from the Chinese is almost correct, here is it out of the article:

“Time and again, through the translators, they made clear they did not understand this concept,” said Nick Marchica, an engineer and former agency senior aide. “What they told us was, ‘As far as we are concerned, voluntary means we don’t have to.’ ”



We learn today, in the wake of all the poisoned dog food and harmful toys, that the Consumer Safety Bureau in the Dept of Commerce was cut in half as soon as Bush came in, and was put under a party hack with strict orders to go easy on the safety requirements. Their budget for
monitoring the safety of American consumer goods is now less than half of that for the bureau that monitors animal feeds.

Conservatives say that voluntary guidelines developed by industry are better than guidelines imposed by meddling bureaucrats, and this is the management line now at the Consumer Safety Bureau. Sounds good. But it took the Chinese importers of poisonous and adulterated and unsafe stuff to make it clear. Of course their stuff didn't get stopped at the border
by consumer safety inspectors, because there aren't any, most of the time (they now have to work from home, as their offices were abolished, and their numbers are down by 60 percent), and their testing equipment is whatever they had 10 years ago. It's OK, we can rely on the
manufacturers adhering to voluntary standards.

What did the Chinese say about this? One toy maker summed it up. "We don't understand what is the problem. Voluntary means, we don't have to."

Never mind, we don't have to run tests and require standards. We just wait until a bunch of people get sick and die, then we look into it. Cheaper that way.

John

P.S. I did start out as a Republican, you know. Stuff like this changed my mind.

Prakash Sundaresan of Microsoft: From Database to Complete Data Platform

Microsoft's vision of a Data Platform that covers "all data, all tiers, all services". This is from a new blog by the leader of Microsofts database R&D team in China. I think this is a blog to keep an eye on...

http://blogs.msdn.com/prakas/archive/2007/09/03/from-database-to-complete-data-platform.aspx

Sonic.Net’s SF ComMuniFi Plan

Community-based free WiFi sounds like a much better plan than through a behemoth ISP like Earthlink. I am going to keep an eye on this. BTW, I use http://gigaom.com/2007/08/31/sonicnet-meraki-team-up-for-sf-wifi/

Community publishing with wikis.sun.com

A very nice video showing the evolution of publishing and where we are now at Sun: how anybody at Sun can create a documentation or other "space", and how anybody can participate in managing, creating, refining that space.

I looked at wikis.sun.com. You can stell it's just getting started. But the potential is quite big, and the video really helps capture that.

Saturday, September 01, 2007

The Myth of the Benevolent Dictator

Josh Berkus has some things to say to those who think that the only way for a project to succeed is with a "benevolent dictator" running the show.

http://blogs.ittoolbox.com/database/soup/archives/the-myth-of-the-benevolent-dictator-18668?ref=http%3A%2F%2Fwww.google.com%2Freader%2Fview%2F

Nice sample of how to easy it is to generate JSON using JAXB with Jersey

Japod comes through with a great blog showing how easy it is to write a REST-based web service using Jersey that can generate results in both XML and JSON using a few simple annotations

http://blogs.sun.com/japod/entry/json_representation_of_jaxb_object

Wednesday, August 29, 2007

Microsoft employee says (anonymously on FakeSteve) that Vista is just *not good*

Makes me even happier I switched to Mac...

http://fakesteve.blogspot.com/2007/08/stunning-post-from-microsoftie.html

Java DB: It's both embedded *and* a server

Some emails I have been reading indicate that not everyone knows there is this cool feature in Java DB/Derby. With a simple call in Java or by setting a property, you can have a VM with an embedded Derby database that also allows other processes to connect to and use this database through the network JDBC driver.

The instructions on how to enable the network server are here.

You either set the property derby.drda.startNetworkServer=true in your derby.properties file or you can start it explicitly:

NetworkServerControl server = new NetworkServerControl();
server.start (null);

Pretty darn simple...

Tim Boudreau moves, with flash and fun

Tim Boudreau is quite a character, and this latest foray, driving a NetBeans truck he painted himself across country as he relocates from the West Coast to the East Coast, is just plain fun and cool.

http://weblogs.java.net/blog/timboudreau/archive/2007/08/the_netbeansmob.html

Jet Lag program was a success!

I applied the jet lag program I had recommended here, and I also supplemented it with Damon's acupressure/affirmation program that he referred me to in a comment.

Thanks, Damon, that really worked! Another benefit of blogging :) It's right up my alley (being from Berkeley).

Something about pressing all those points and reminding myself to feel good -- I found myself relaxing, breathing better, and feeling refreshed. I had zero jet lag in both directions, on a five day trip. I didn't sit up wide awake in the middle of the night or collapse in the middle of the day.

Yes, it sounds all wooey/New Agey, but hey, I am an open-minded scientist type and will try anything that doesn't sound harmful or cultish. Before you pooh-pooh it, try it yourself.

Prague Trip



OK, Heathrow was hell, but Prague was quite wonderful. I actually was able to get away from the office on Friday afternoon and take a walking tour of Prague. I highly recommend Prague Walks They have all sorts of walking tours - the one I took was three hours with a very knowledgeable guide and included a stop half-way through at a pub for a foot rest and a local beer. What a great way to spend three hours!

More photos can be found here. They're with my crappy cell phone camera, I forgot to bring my regular camera (probably a good thing because it would probably still be sitting in Heathrow in my lost suitcase), but there are some good shots in there considering.

Tuesday, August 28, 2007

Heathrow Hell












I remember seeing Simon Phipps links about Heathrow, but didn't really pay attention. I didn't have any idea how bad it could be.

When you exit in England, you simply go out, get your baggage (although that did take 45 minutes), catch the Heathrow Express, and you're good to go. On the way back in, you go through security and on to your plane.

Ah, but when you're transferring flights, it's an entirely different, and hellish, experience. There is no one international terminal, so you have to be shipped from terminal to termnal on a bus. Our bus got stuck behind a luggage cart that had lost its luggage. Their transfer stations are completely overwhelmed, and it takes an hour to get a boarding pass for your next leg of the flight. Worst of all, the UK doesn't trust any other country's security and you have to go through a security check even though you went through one at your original departing airport. And this security is completely overwhelmed and the line is (if you're lucky) 45 minutes to an hour long.

The worst part of this was that I got the sense that the staff there really didn't really care if this was an inconvenience, it's just the way it is. And at Virgin Atlantic, when they were continually screwing up my ticket, they kept intimating it was my own misunderstanding of the arcane rules of airport/airline bureaucracy that was causing the problems. Deal with it, passengers, it's not our problem, was the general feeling.

As a result of the delayed flight and eternal security line, I missed my connection. So, I get put on a BA flight. Back to Terminal 1, the terminal I started at. And guess what, I have to back through friggin' security because I have been "mixed" with unchecked passengers. And nobody seems to think that maybe, just maybe, there could be a better way. Deal with it, passengers.

I checked at the gate to make sure my luggage had followed me, and they assured me it had. When I get to SFO, no luggage. Since then I have been calling every day, and today they told me that it often takes a month for someone to get their baggage back. A MONTH!. I was this close to packing my laptop on that suitcase...

I can just see the folks at Heathrow standing around, hands in pockets, taking a break, not really caring, and my luggage just sitting there. Someone glances over at the bag. "Who's luggage is that?" someone asks. "Dunno." says someone else and shrugs. Oh well... Not my problem...

Heathrow is an old, massive, airport, that is completely overwhelmed. This I understand. But the general apathy of the folks working there, the complete disregard for passengers, is unforgivable. They should have a sign over the airport as you come in: "Deal with it."

I was complaining to one of the people helping me with my lost luggage about Heathrow, and she said she personally will not go into Heathrow as a passenger, at least until the build their new terminal. A flight attendant on the BA flight also confirmed that Heathrow is absolutely hellish and to be avoided.

So Heathrow is permanently on my black list. I hope some day the airlines realize they are losing customers because of Heathrow, and start making deals with alternate airports. I hope some day Heathrow realizes that passengers are actually what they are there for, and without passengers, you have no airport.

Personally, I am one passenger they have lost, and I'll also be telling anybody else I know to avoid Heathrow at all costs as a transfer destination. If I am transferring in Europe, I will go through any airport other than Heathrow.

Deal with it, Heathrow.

P.S. Reading the comments on Tim's blog about Heathrow, it sounds like Frankfurt and Amsterdam are great choices, and that Paris, Gatwick and Stansted are all pretty close to Heathrow in terms of pure yuck.

Rick Hillegas talks to us about Java DB

A nice quick podcast where we get to hear Cloudscape old-timer Rick Hillegas talk about Java DB. The interview with Rick starts about 6 minutes in. Really direct, informative podcast.

http://today.java.net/pub/a/today/2007/08/27/javamobility-podcast17.html

Friday, August 24, 2007

Password encryption in Derby 10.3

A reader asked if password encryption is enabled by default in 10.3. I checked with the Derby team, and the answer is, no, the password is still sent in the clear by default in 10.3. You have to enable it by setting the securityMechanism property on the URL.

See http://db.apache.org/derby/docs/dev/ref/rrefattribsecmech.html for more details.

English Cheddar in the Colonies!

In response to my post about the London Cheese Shop (no, not the Monty Python Cheese Shop, they actually have cheese, including Cheddar, and they weren't playing a bloody bazouki), my sister posted info on the name of the shop and their web link, and my Pa then found a US purveyor.

Elizabeth:

The shop is Neal's Yard Dairy - the cheeses are locally produced English ones with the names of the farmers on them! Here's the website:

http://www.nealsyarddairy.co.uk/thecheeses.html#

David tried the Montgomery Cheddar, if you click the link you can see more pictures.

Me dear ol' Pa:

Not only that -- I went to the website and found that they retail in the USA via select fromageries. Voila! Montgomery cheddar!

http://www.bedfordcheeseshop.com/catalog/?id=33

Fake Steve and SUNW=>JAVA - Ouch!

Fake Steve is having some fun about the change from SUNW to JAVA. Ouch, that stings! :)

http://fakesteve.blogspot.com/2007/08/more-big-changes-coming-at-sun.html
http://fakesteve.blogspot.com/2007/08/i-stand-corrected.html

PostgreSQL 8.3 is faster with sequential scans

A nice blog from someone showing the performance improvements for sequential scans in the latest PostgreSQL release.

http://www.commandprompt.com/blogs/joshua_drake/2007/08/postgresql_83_its_faster_really_it_is/

Top 25 responses to Sun’s JAVA move

I still feel than this move was bold and audacious. But I think these responses highlight the very good points that (a) Sun is much more than Java and (b) Java may not have legs -- will it still be as big 10 years from now? Hmm...

http://blogs.zdnet.com/Burnette/?p=372

Thursday, August 23, 2007

Russell Beattie - eBay has real problems

Russell encounters serial eBay account theft. This is the kind of bad press that can really impact a brand like eBay. Security is and will alway be a major Achilles heel of online business.

http://www.russellbeattie.com/blog/ebay-has-real-problems

The RDBMS is dead. Long live the RDBMS!

I've been seeing a number of posts about the death, or at least increasing irrelevance, of the RDBMS. First I read Nitin Borwankar's article about how Web 2.0 disrupts our database world. Then I found this post by Alex Bundardzic saying that Ruby 1.2 drives the final nail into the RDBMS coffin. Then just today Arnon Rotem-Gal-Oz says that the RDBMS is dead.

What the heck is going on here? Why is everyone claiming the irrelevance or actual death of the RDBMS?

Alex's blog is one I don't fully understand, but then again, I don't think I fully understand his Resource-Oriented Architecture, and I've never used Ruby on Rails. I can't see how REST support in Ruby on Rails somehow gets rid of the need for an RDBMS.

But let's look at the other two. Both Nitin and Arnon are talking about the impact of scale. Nitin also talks about the impact of hierarchical organizations such as social networks that are very hard to translate to a relational model and still get good performance.

To be honest, I think the biggest challenge is scale. Web applications are attracting a user-base that is not just your own company's employees, but an ever-increasing vast sea of global consumers, millions and millions of them. If your web application is successful, you may need to hit levels of scale, reliability, scalability and availability that you never thought possible, and definitely far beyond what relational database vendors thought possible when these systems were first architected.

With this kind of scale, you have to try to eliminate every single point of contention and single point of failure in your system. You need to be able to distribute it across thousands of machines where every request can run independently and on any machine. And the problem is that the database is a big point of contention, because it implements transactional semantics, which thus require centralized locking and storage to disk, creating bottlenecks and slowing everything down.

So I agree with these authors that Web Scale is forcing us to do a major re-thinking of how and when to persist data, and ask questions about how important, really, are ACID semantics and normalized data? Where and when can I let go of atomicity, consistency, integrity and durability (ACID)?

This reminds me of what airlines do. You book a flight, and you have the impression that they have reserved you a seat on the plane. Well, they have, and they haven't. In their case they need to optimize for the fullest flight possible, and people are unpredictable. We commit to being there for the flight, but sometimes we don't show up or cancel at the last minute. So, they overbook. They take the risk that everybody or almost everybody shows up, and if necessary they do a compensating transaction (literally) by paying people to take another flight. This potential cost is worth it to them in the long run.

In the same way, you start making calculated risks because scalability and performance are so important. You risk some loss of data and use a "lazy cache" (at the disk level or above) that batches up writes rather writing to disk for every transaction. You use more relaxed modes of maintaining consistency with things like optimistic concurrency and compensating transactions. You let the client manage some of the durability by sending it a representation of the current state and let it ship that back to your for the next operation (this is the REST model).

Another issue of scaling is the fact that databases tend to be centralized, and this creates a bottleneck. Oracle RAC is clustered, but it can't scale to hundreds of nodes because it's busy managing locks and shipping data around.

The centralized bottlneck of an RDBMS can often be solved at the application level by partitioning your data across multiple databases. This is what eBay does - each request is keyed off of the user id and sent to the appropriate database/app server partition. But this does require a domain model where there is as close to zero data shared across requests. Otherwise you just end up duplicating the bottleneck at the application tier by shipping data between application servers. This is another way where the REST model of shipping relevant state back to the client comes in handy -- the client can provide all the context it needs for each request, and the server doesn't have to keep this stuff around (and potentially share it with another server in the cluster).

Finally, maybe not everything has to be stored in the relational model. Maybe you can get by with a key/value store like Berkeley DB. Or maybe you can just keep some of your data in a clustered in-memory hashtable like memcached or Gigaspaces[1]. If you can do this, it can give you some serious performance wins.

But does all this make the database "dead" or "irrelevant?" I don't think so, and I don't think these authors really think so either (well, I don't know about Alex). I think it's very very good to have something that will give you the ACID guarantees and the power of SQL when you need it. It's a sense of security and safety, like having a home to come back to with a warm fire and a cup of cocoa after having a wild old time on the town.

It just means we have to re-think any tendencies we may have that everything has to be completely correct and perfect and relational when dealing with our data. Sometimes sloppy but quick is the best way to go.

[1] Gigaspaces is actually a lot more than just an in-memory hashtable. Because they store objects, then you can keep your data and logic close together, and in almost all cases this allows you to process a request on a single machine. This can be a very big performance and scalability win.

Jersey (RI for Java REST JSR) will be made available as a Glassfish plugin

Japod of the Jersey team talks about how you can install the Jersey implementation as a Glassfish plugin. Pretty cool! Also, I didn't know about the Glassfish plugin framework - that's pretty cool too!

http://blogs.sun.com/japod/entry/jersey_will_soon_be_available

Sun's stock ticker symbol becomes JAVA

Wow. Bold, audacious, wild. This guy never stops having fun.

http://blogs.sun.com/jonathan/entry/java_is_everywhere

Wikipedia becomes Bureaucrapedia

A very sad and telling article about a growing rabid deletionism in Wikipedia. I liked this quote: "It’s as if there is a Soup Nazi culture now in Wikipedia." Is Wikipedia evolving into irrelevance? Hopefully the pendulum will turn.

http://www.roughtype.com/archives/2007/08/rise_of_the_wik.php

Java Kernel is Ready?

The java.net editor discovers through a one-line blog that Java Kernel is in the next update of JDK 6. Is this really true? If so, it's time to try it out!

http://weblogs.java.net/blog/editors/archives/2007/08/nobody_told_me.html

There is no Web Operating System (or WebOS) (by Jeremy Zawodny)

Great blog that nails my own discomfort with this "Web OS" which has always felt kind of vague and hot-airy, a way of trying to shoot barbs at Microsoft. "The web is open and decentralized. Everything is one click away. Remember that."

http://jeremy.zawodny.com/blog/archives/009417.html

Wednesday, August 22, 2007

Gastronomic delights in London

During my quick day-trip to London on the way to Prague, my sister Elizabeth and her hubby Henrik took me out on a wonderful trip on the town. They took me on my favorite kind of bus, a London double-decker (top deck of course), to an open market area that is usually completely packed, but today it was quite mellow and peaceful.

Our first stop was a great little tea shoppe where we had fruit scones with clotted cream and jam, little tea cakes, and incredible, delicious Earl Grey tea.

Then we wandered next door to a wonderful cheese shop, full of cheeses made by local British cheese "artisans." They had the infamous Stinking Bishop from Wallace and Gromit.



Henrik had me taste one of the cheddars. Wow! Incredible. Nice smooth fore-taste, and then an everlasting tingling sour/nutty after-taste. Never had anything like, nor do I expect to ever find anything like this in the USA.

I loved the atmosphere of the shop, with its full rounds of cheese and the "cheese waterfall" that kept the shop nice and moist.













Then, round the corner to a sweet little coffee shop. I really liked the communal wood table that people shared -- you just don't see that in the USA, and I wish we'd see more.



My cappucino was perfect, better than almost any I could find in the Bay Area, which is supposed to have pretty darn good coffee. There was also a hand-made chocolate truffle that was astonishingly good.

So if anyone says British food is bad, tasteless and dull, they should check out London these days. It is quite a change from some of my first visits to London, where the food was just ghastly. Elizabeth credits this to the EU, which allows for more cross-pollination from the Continent...

One last thing to notice: those little clips hanging below the table at the coffee shop.



What are those for? Obvious, says Elizabeth: to hang your purse from, so they won't get stolen. Now that's a cool idea...

Eep! -- Blogger in German from Heathrow

I am in the Heathrow Airport, and when I go to my Blogger page, it presents everything in German. Automatically. Isn't that special. I checked the Google FAQ and it says I need to set my default language to English in my browser. But it's already set to English.

I finally found this blog by Amit Agarwal that says I have to remove my temp folder and then set my default language at http://www.blogger.com/language.g. Sheesh! It would be nice if this were documented, rather than me having to search for a blog to do it.

Monday, August 20, 2007

David Duffield's Workday ERP System Uses In-Memory DB and Metatags

Very interesting note from Nicholas Carr about what David Duffield is up to these days.

http://www.roughtype.com/archives/2007/08/the_end_of_erp.php

Detecting the version of the Java VM you're in

This source code comes from the Derby source base. Very useful in cases where you want to load a particular class or do other things based on which VM you are running in. In Derby's case this is used to load the appropriate JDBC driver.

http://svn.apache.org/repos/asf/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java

Friday, August 17, 2007

Book Recommendation: Overcoming Jet Lag




I'm going to Prague next week for work, so I'm pulling out this great book that my ex-boss gave to me, called Overcoming Jet Lag.

It is based on research done by the government for travelling officials, and it has a very easy-to-follow program based on principles of the internal clock that they uncovered: light and dark, diet, caffeine, and activity. I've used it before for my trips to Norway, and they have really worked. Highly recommended.

Tips for migrating a MySQL database to Derby/Java DB

A more and more commonly asked question on the Derby user list is "how do I best migrate my database from MySQL to Derby".

A very useful way to do this is through DDLUtils, a very nice utility that lets you export a database schema from one database and create it in another. Here is the MySQL page from DDLUtils.

But I also thought I'd share what looked like a very useful email from one person who did it. Note the interesting tips about non-standard JDBC that worked in MySQL but which Derby did not accept.




>If you don't mind - what were your top three pains when moving from
>MySQL to Derby?

Glad to, if it will be of any interest, although the problems were
probably a result of our* own inexperience and naivity.

1. We used DdlUtils to do the migration, did the conversion form
MySQL to xml ok, but then encountered errors on conversion to Derby.
These threw us initially because they related to primary keys not
being unique, but eventually we realized that this was because
MediumInt is only supported in MySQL and the conversion changed it to
a Small integer. I guess we should have inspected the xml schema more
carefully. I had consulted the page:

http://db.apache.org/ddlutils/databases/mysql.html

And my one suggestion here is that the conversion table on that page
should include the recasting of mediumint - presumably an oversight.

2. The other problems arose at runtime after apparent successful
conversion, and also arose from the non-standard nature of MySQL.
There were three aspects of the java code of my app that Derby took
exception to. One was a JDBC ResultSet method (first()) I had used in
a hack to check for empty tables. It turned out Derby didn't like
this and made me use some JDBC2 method for scrolling the table. It
also wouldn't allow a finally{} clause for closing a connection that
it already handled itself (easy enough to remove) and wouldn't allow
a faulty SQL query that MySQL had ignored (typo of GROUP instead of
ORDER - for the correction of which I thank it).

So the moral is perhaps that Derby is to MySQL as Java is to Perl -
it won't tolerate the sloppy habits you had become accustomed to. :-)
(Apologies to the Perl community)

An old neighbor ends up in Arbil, Iraq

A neighbor of mine (well, he recently moved to Virginia) has ended up doing microfinance consulting with a bank in Arbil, Iraq. He's been sending us amazing missives about his life in the compound. They're in MS Word format, and I'm trying to convince him to turn it into a blog (maybe he doesn't have good enough Internet access for that).

Anyway, I thought I'd share his latest note.


Friday 1 PM

Hi everyone,

We work Sunday through Thursday so today is my day off and I slept in. It is approximately 112 degrees outside. I wanted to address the security issue. I’m getting some inquiries and people are wondering if I am in harm’s way.

Search the internet for a good map of Iraq and look at the top of the country. Kurdistan is sometimes confused with the "northern provinces" and the media continues to not distinguish between ethnic Kurdistan and the northern provinces. Mosul is violent and is up north, yes, but way east over near the Syrian border. Kirkuk is dangerous and there are lots of "incidence" down there and that is why we never entered the city. Even though the micro finance bank that I am consulting for operates there, no westerners in my parent organization enter the city. Everyone thinks that after the November election ( here ); Kirkuk will be ethnically cleansed and all the Arabs that Sadam moved in, will be kicked out…. or whatever. The Kurdish paramilitary is ready and they want the city back as well as the oil.

Anyway, Kurdistan is the three or four provinces that form a little icecap across the top of Iraq and border Turkey and Iran. The nasty genocide that occurred two days ago, for example, was outside of true Kurdistan but the area is obviously still populated by Kurds. The distinction is critical to understand, just because some bombs go off, and it is "up north" and some Kurds die, does not mean it is in Kurdistan. This may seem like trivia but I am depending on it. This city, Erbil, has a ten foot moat, or ditch, dug all the way around it to stop vehicles from entering cross terrain. The only way in is on the paved road, through multiple checkpoints guarded by the Kurd Army and the paramilitary. Voila ! No ethnic Arabs allowed. Period.

Nothing is perfect, and that is why I cannot leave the compound. It ( the compound ) is in a suburb of Erbil somewhere near the airport, and is occupied by a variation of religion that I am not sure of, I think there are Christians here or something. The suburb itself is surrounded by walls with watchtowers and guards. I live in a compound within the suburb that, as you already know, has blast walls, only one vehicle gate in and a different one out. The road to the gate has concrete diversions so an approaching car has to go really slow or it will crash. Everyone stops at the gate and the guards run a mirror under 360 degrees of the car, then the sniffer dog does it again. All supervised by Triple Canopy staff ( Google “Triple Canopy” and you can see the level of security that is provided to westerners ) No bombs allowed ! Worst case scenario is that somehow a person gets in past the gate and starts shooting up the place. They would last about one second. There are literally hundreds of armed people here including heavy duty westerners ( South African mercenaries ), not just the Kurds. Or, if someone drove close enough to the suburb, they could touch off some mortar rounds, but that would be so inaccurate that I don't even think of it.

Sorry for all the details, but information can cause relaxation, and that is what I am trying to convey. After all, there were drive by shootings almost every night on the commute path I took through north Oakland when I came back from the bank in Fremont. One of our friends was held up twice on the foot path between the BART station and his house in North Berkeley. So “safe” is a relative term.

It's noon and I am leaving the house to get lunch. Tonight I am hoping to get a security guy and go out of the compound for dinner. If not, then I will stay here, locked up like a caged rat. There is a big citadel about a mile away ( in the suburb ) and it old and famous. Maybe I can include that in my adventure if and when I can arrange an outing.

Best Regards to all

How to upgrade a Derby/Java DB database

With the recent release of Derby 10.3, it's relevant to ask - what happens to the database you created with an older version when you upgrade Derby or Java DB?

Well, Derby is focused on ease of administration and embedded use, and this includes seriously painless upgrade.

There are two types of upgrade: soft upgrade and full upgrade.

With soft upgrade, you can use a new driver to work with a database created under a previous version, but older drivers will still be able to work with the database too -- the database itself is not upgraded to the newer version/format.

This is convenient if you want to just try things out, or if you have a mixed environment where some users are still using older versions of the driver.

The drawback of this approach is that if there are new features in the newer version that rely on a new database format or new system metadata, etc., then you can't take advantage of those new features. For example, Derby 10.3 has added features for security, SQL, and administration that won't work with an older database.

That is where full upgrade comes in.

You don't need to do anything crazy like export all your data, create a new database, and recreate your tables and load your data. All you have to do is set the "upgrade" property to "true" when you connect to the database.

There are two ways to do this. You can set it as a property directly in the URL, e.g
   "jdbc:derby:travel;upgrade=true"
or you can add it as a property when you get the connection, e.g.

String dbURL = "jdbc:derby:travel";
Properties connProps = new Properties();
connProps.put("upgrade", "true");
Connection conn = DriverManager.getConnection(dbURL, connProps);
One important caveat: if you have created a database with a non-GA version of Java DB you can not upgrade it. This is because there is no commitment to support upgrade from what is basically an experimental database. All this mean is, please don't deploy a production solution using Java DB with a beta version of Java DB.

Thursday, August 16, 2007

Larry Ellison: Open Source has no value in and of itself

From an interview with Larry Ellison:

Regarding future challenges, Ellison dismisses open source as a threat to Oracle.

"Open source is not something to be feared. Open source is something to be explained. Open source wins not because it's open and not because it's free. Open source wins only when it's better," he says.

To me this is another example of Oracle trying to address open source by dismissing it. Of course people only choose something because it is better. But Larry doesn't acknowledge that open source is inherently better because it is open and free.

When it is open, it allows for innovation. When it is open, it prevents you from getting locked into a single vendor. Both OEMs and customers trust it because it is not controlled by someone who may be a competitor either in business or politics. When it is free, it delivers significant price/performance benefits.

Larry goes on to say

the purchase price of software is only about 10 percent of the total cost of ownership of software. So even if the software is free, the most you can save is 10 percent off. Now the question is, what are your other costs of developing applications, of running applications on a daily basis, of dealing with problems when they occur? We think that Oracle is absolutely very competitive with open source

I think what Larry is saying here is that open source, if it is poor quality, gives you longer-term higher costs in terms of day-to-day maintenance. But I don't know if there is any data that shows that PostgreSQL or MySQL is not as stable or reliable as Oracle. And here again he is missing the value of open source: the community makes open source more reliable over time, because there are more eyeballs and more people making fixes. It's true for security, and it's true for quality.

My general feeling is, Larry is trying to pooh-pooh open source, because his customers are looking very closely at lower-cost and independent solutions. So Oracle's job is to dismiss and scare and keep their customers from taking open source databases seriously. But if I were Oracle, I'd be checking my rear-view mirror, because history has shown that open source goes where you never expect it would go: operating systems, applications servers, office suites, and, yes, enterprise databases.

Code For Freedom in India

Sun India is having an open source coding contest for university students across India called Code For Freedom - in honor of the freedom of open source and the freedom of India found 60 years ago.

From the site:

Sun Microsystems is happy to announce the Code For Freedom contest where students across India contribute to the technologies that are empowering the participation age. Participating in this contest will provide you with precious industry experience while still learning in college. And there is more. We in turn reward you for your valuable contribution in taking the first steps towards the open source movement.

For more information, see http://in.sun.com/communities/univ/codeforfreedom/

Happy 60th Independence Day for India



This week celebrates 60 years of independence for India. I have always, always been struck with the way that India obtained its independence. Here in America, we fought with gun and musket; in India, it was fought completely with non-violent means. As always, India is giving the world deep and profound teachings.

Many people complain about our jobs being taken to India. But I know for a fact that Indians have been a huge component of the technical revolution from the beginning. And I want to honor and thank all of the contributions from the great Indian community.

I also want to thank India for giving me personally a vast and deep ocean of wisdom from which I can draw. Great statements such as tat tvam asi ("Thou Art That") and chittam mantraha ("The mind is mantra") have been food for years of contemplation and practice.

And the Indian people - sweet, kind, patient, funny, hard-working, passionate, disciplined. I want to thank and honor all of my Indian friends and colleagues.

Happy Independence Day!

An Earth Without People -- an interview with Alan Weisman



A great interview with Alan Weisman, who has a book out which predicts what would happen if humans were to disappear tomorrow. I've always wondered what it would be like if/when nature takes over.

http://sciam.com/article.cfm?chanID=sa006&colID=1&articleID=2691D716-E7F2-99DF-38F54EF6075AAB4D&ec=b_cn

NetBeans 6 will be dual-licensed with GPLv2+Classpath and CDDL

This email from Bruno Souza, community manager for NetBeans, outlines the plans to provide an EA version of NetBeans 6 that will be dual-licensed with CDDL and GPL v2 with Classpath exception. Very cool!

For more information, see the FAQ.

Cool Stuff with Sun's Cool Threads T2000 and PostgreSQL














Thanks to Max for pointing this out. Not only is the price/performance significantly better ($26 vs $113) with the T2000/PostgreSQL vs HP/Oracle, but the T2000 delivers 1 1/2 times higher performance per watt. I love the DB licensing cost of $0 for PostgreSQL.

Wednesday, August 15, 2007

Roumen's Wiki Rant

Roumen hits the same frustration that I did about varying Wiki formats. Someone please save us all...

http://blogs.sun.com/roumen/entry/rant_about_wikis

Alex Bunardzic » Resource Oriented Architecture

Alex Bunardzic presents a series of blogs on the concept of Resource Oriented Architecture, or ROA. He is emphasizing the fact that a resource and its representation are two different things, and a model of web-based programming that embraces this.

http://jooto.com/blog/index.php/category/resource-oriented-architecture/