Archive for September, 2006

EJB 2.1 Transaction Demarcation Defaults

Thursday, September 21st, 2006

In a discussion the topic of defaults in transaction demarcation for session beans I made an interesting yet somehow shocking discovery. Someone wanted to tell me that the default would be Supports (which means transactions are supported but aren’t created for the called method if none exists). Since all our session bean methods use access the database and write data this didn’t make sense. So I went through the specification, and to my surprise found not a single mention of the default transaction type to be used by the container in case the assembler forgot to specify it. Nothing on unspecified behaviours in this case either.

So the code worked until now without explicit demarcation, what gives? Seems like the JBoss default is Required (i.e. create a new transaction or use an existing one). While you shouldn’t rely on the default here, I’m rather shocked that it’s not mentioned anywhere. I browsed a few books on EJBs, searched the JBoss website, nothing except these forum posts.

I made sure the deployment descriptor now correctly demarcates the correct transaction type, but that still leaves a foul taste. So make sure you don’t rely on defaults, but declare exactly what you’d like the container to do for you.

Mind you, this changed in EJB 3.0, where Required is the default, in both annotations and the deployment descriptor.

External JavaScript Files and script-Tags

Tuesday, September 19th, 2006

I spent half of the day hunting down a nice issue related to external JavaScript files and a group of `

The block containing the variable declaration never got executed. The reason? Both Firefox and Internet Explorer went straight ahead and parsed the stuff until the ending `` and because of the fact that `

As an experiment I tried declaring the HTML as being XHTML, but even that didn’t help. Or maybe I have been staring at this code for too long.

All those doubts and fears that I’m too stupid for this, they’re all real!

TextMate Book in Beta

Tuesday, September 12th, 2006

The Pragmatic Programmers have a new title in stock. “TextMate: Power Editing for the Mac” is now on the shelf in beta. Sweet! So TextMate now joins the likes of Vim and Emacs to have its own book as a text editor. Author is James Edward Grey II who also authored the Ruby Quiz and the corresponding book.

Great stuff! Now if they’d only sell the time to read all those books.

Java Persistence with Hibernate now in MEAP

Tuesday, September 12th, 2006

Finally, the second edition of the classic and must-have “Hibernate in Action” finally made it to Manning’s Early Access Program. The first chapters of “Java Persistence with Hibernate” are available now, with more to come. The book will of course also feature EJB3 related information.

Looks like Hibernate finally gets a worthy reference manual. As much documentation as there is, it’s still very under-documented. Hopefully the second edition fills this void even better than the first one.

More on Freelancing

Sunday, September 10th, 2006

Over at Brian & Stephanie Reindel’s Blog, they wrote up a nice piece about freelancing. “A programmer’s pocket guide to freelancing” is a nice write-up about some common pitfalls including finances, contracts and self-marketing, and full of good advice. A nice addition to my earlier posts in this category.

And if that’s not enough, there’s also a small essay about common pitfalls in resumes. Very good advice, not only for freelancers, of course. Your profile is the first contact a new customer or employer will have with you, so you better take good care of it and make it a good and fitting representation of you and your skills.

Excellent stuff.

Freelancing Adventures, Part II: Getting new Gigs

Monday, September 4th, 2006

When you’re a freelancer, you usually don’t work very long on a certain project. You need new gigs every now and then. There are a lot of ways to get one, and for me until now, many of them (yes, even in the quite small time of my life as a freelancer) worked out well. Don’t settle for a specific way to get your hands on new projects. Play the field, take it all in, and chances are you can make choices.

The following list is probably far from being complete, but it’s a start. It’s what I usually recommend to people and what worked well for me. Most of them are not only applicable for freelancers, but people preferring being an employee too.

__Build a Network__

This obvious, but it can’t be said enough. If you know people, they know you. It’s that easy. Go to business events, user group meetings, a regulars’ table for freelancers, conferences, you name it. Get to know people and make them get to know you and your skills. Join a social networking platform. Something like OpenBC or LinkedIn will do. I’ve heard of people who got gigs through MySpace, but I’m not in that camp. The same probably goes for Orkut. Some people tend to misunderstand the tool of social networking. Many people at OpenBC like to use the forums as a way to show off or to to offer their services. While that’s nothing unusual, there’s something uncomforting about the way some of them do it. Post a question, and your answer is something like “My company has the perfect solution for your problem. Maybe we can talk in private and I’ll make you a good offer.” That’s probably one of the main reason why not many forums over there are actively used for communication and solving problems. That doesn’t mean you should be offensive about getting your profile to people, but keep it private.

There are also specialized web sites for freelancer and project exchange. A good example in Germany is Gulp (very Web 1.0), freelancermap or projektwerk. Recruiters publish their projects there and look for people suitable for them. So be there or don’t work.

Find people with the similar interests, get in touch, get to know them, ask them what they do, about their experiences with a framework, a language, a certain way to handle certain things, you name it. Tell them about your experiences. Share thoughts, maybe work on a small project together. The better the other person knows your skills the better she’ll be able to recommend you for a job. The same goes for you, of course. It’s not a one-way deal. If you’re asked to join a project, but aren’t able to work on it for whatever reasons, the decent thing you do is think of and recommend your fellow freelancer friends.

__Let recruiters help you__

I actually got in touch with headhunters soon after I became a freelancer. And I’m glad I did it. I got my current job through one. A headhunter (or recruiter) is hired by companies to find people suitable for a project. In the freelancer world they’re usually in a hurry. It’s not uncommon that a recruiter calls you about a project where you’d have to start the very next day. Many customers have projects that suddenly popped up or projects that are on the verge of failing. Both often need immediate staffing and that’s what recruiters get their money for.

In the beginning you usually apply for projects. Recruiters often have special web sites or forms to that where you can put in your details, upload a profile and send it off. The good thing about it is that you usually not only apply for the project. The recruiter will have your details in her database. Of course they usually contact you, if they find your project interesting enough, and ask you if they can can get back to you in the future, or ask for more details for the current project, for that matter.

You do that a couple of times, and usually apply with different recruiters. You don’t need to be good at math to know that more and more people constantly looking for freelancers will know about you. The good thing about this is the fact that in the future they’ll contact you, if they have new opportunities. This doesn’t mean that you can lean back and rely on them to offer you projects on a silver plate, but it gives you a nice edge, and one more way to get new gigs. Sure they want a piece of the money cake too, but hey, they got you the job right?

__Get the Word out__

And I mean that literally. When it comes to a profile, most recruiters want a Word document. They have their reasons, probably. The point is, you need a profile, a good profile, a profile that tells a person everything they need to know about you. I can’t give you exact specification about how your profile has to look, but I can tell you some things that worked pretty well for me:

* Keep it short and simple. A good portfolio tells more than a thousand words. Well, probably less than a thousand words, but it needs to speak in a simple and effective language. Describe the projects you worked on in a short manner. No more than five or six lines per project. When, who, what.

The tripleju is your friend. You need a timeframe, a customer (maybe with a contact for reference, some recruiters like to have that, so customers interested in your profile can call them), and a short description of the project and the technologies you used. Some people tend to write down every little tool they used, even the operating system. For me personally that’s not important, and if you want to have it on your profile, put it in an extra skills list. I wouldn’t put Eclipse into the technologies used on a specific project, because I take it for granted. Yes, I know, others might not, but that’s why you can always put it in your skills list. The point is to keep it focussed. Put in enough information for someone to get a good impression of what you can do. The rest can and will be more detailed in an interview.

* Make your profile available. Nobody will care about what you can do, if your profile is not available to them. Freelancer exchange sites will usually let you maintain your profile for public viewing. So maintain it, maintain it good. Keep it neat and interesting. And keep it up-to-date. Your profile isn’t worth a penny, if it doesn’t contain your recent work. Link it on your blog or personal web site, too. Offer it to people. Don’t be shy to send it to people who only looked for an employee. Sometimes they don’t find someone suited for their needs and might get back to you.

* Make a difference. I know this is easier said than done, but on the other hand it’s not too hard. There’s some conventional and common wisdom concerning profiles. And a lot of people adhere to them. They make weird and stiff looking head shots. They use Times New Roman as the font for their profile, you get the idea. Of course you shouldn’t use Comic Sans (which some people do) or WingDings, or put in a picture of you lying on the beach. But you can spice it up a little, with a clean font (like e.g. Frutiger or Lucida Grande).

You could use a picture that shows you as, well you. Not in some way you’d look dressed-up or uncomfortable. A natural-looking you will say more about your personality than a person looking somewhat like you, but is wearing cloth you’d probably not be wearing to work. Some people like wearing suits, on occasion I do to, but at work I like to wear casual clothing. Yes, that’s sneakers, shorts in summer, and thongs if it’s warm enough. Fortunately your picture only shows your upper body. Wear something you’re comfortable with, but don’t look too geeky, of course. The same goes for an interview. A few years ago I wore a suit everytime, until I found myself being always over-dressed, and turned to a Dickies, neutrally looking sneakers and something like a white shirt. That’s me, and he who prefers to judge me based on my clothes, maybe I don’t want to work for him.

In the end it’s up to you to draw a line between you and the rest. But it’s important to find that line. Of course you can constantly redraw it, as long as the line doesn’t cross you and the rest, you’re fine. Think about stuff that makes you different, more interesting. I for one have made good experiences with presenting myself a little unconventional. As long as your profile still says enough about you and your skills, you mostly can only win.

__Don’t put two eggs in one basket__

Many projects look for people through different channels. Recruiters usually compete for people to staff open positions. So you’ll be offered the same projects more than once. Don’t be tempted to apply to more than one recruiter for a project. The person on the other end of the pipeline, who decides who’ll get the job, will then have to choose between the two (or more) recruiters. They too want their money, you know. You could say that it should be first come first serve. But in the end you could loose either way, because the person on the other end doesn’t want to make that decision and prefers people placed targeted applications. It may or may not work, it’s not easy to say, but if you don’t hear again from either of the recruiters, chances are you’ve been dumped for said reason.

So when I say play the field, I mean the field where you don’t pass the ball to the same player twice, but where you let everyone have a fair share of ball-time.

Sometimes it’s not easy to tell if a project offered by two recruiters is the same. They usually have the same list of requirements, but when in doubt ask, and ask about wages. In doubt you can always chose the recruiter who’s willing to offer you more.

__Learn to say no__

I know, you’d love to please everyone, and work on two or more projects at the same time. There’s the money, people will like you, your profile will shine, and everyone will win. Unless you want to work 16 hours a day to satisfy two customers, you better learn to say that word that nobody likes to say. Parents maybe, but even they hate to say it to their children.

Saying no is an important part of getting new gigs. You can’t do several projects at once. Well, of course you can, but ask yourself, is it really worth the sacrifice of time, personal life and health? Not only you will suffer, the quality of your work usually will too. Being able to say no is a good thing. Enjoy the pleasure of being able to choose. I know I do. People say no to you all the time. Well, sometimes they don’t, but would like to, but lost your phone number, and you’ll find out on your own anyway when they didn’t call you after some weeks. So why won’t you? It’s not only a pleasure for you. Not being able to make up your mind doesn’t help the others either. They rely on your decision. If you say no, they can move on and ask the next person. Of course it sometimes hurts to let go of a great project, but if you don’t have the time, you don’t have the time. Don’t be afraid to disappoint someone, because you won’t. They’re used to it. So should you.

That about sums up the experiences I made over the last months, and years, since most of it not only applies to freelancers. As a good employee you’re better off standing out of the crowd, having a good profile, contacts and even have recruiters looking for you. Pick what works for you, refine it, suite it to your needs, but do something. A new job usually goes a long way, but you can shorten it considerably when you do something about it.

I welcome further advice.