Java Workshop

Yesterday evening we did an internal workshop. I explained Hibernate a bit Jacob (a collegeau) also shared his experiences on the Hibernate topic as we implemented Hibernate in a totally different way. Afterwards Jacob gave a session on Spring Webflow. I have to say it’s been a while since I went to programmers workshop. Our l2u meetings are not actually coding, more setting up and explaing new stuff. But hey I’m a coder, not an administrator but as most geeks I know my way around administration as well but it’s not my core business 🙂

I spend quite some time preparing the workshop, I even listened to a session of gavin himself recorded on a mp3 player. (I’ll put it up later.) I made a small example and then I did a pojo with 2 relationships to other tables. While preparing this workhop it gave me the opportunity to take a closer look at the things we don’t use in our project. .e.g. we always use HQL to retrieve our objects. Never do we use the Criteria classes way, it comes down to the same thing but it’s more Object oriented then an EJBQL like query 🙂

Although Jacob his session was rather short (due to our enthousiasm) it was really interesting. I had read the spring book, but I can’t remember much from the web flow framework besides it being a continution framework. I have to say it was a lot to take at once but it’s really really nice.
As most of you might know one of the common problems in J2EE web application is that if a user starts at page A, go’s to page B, go’s to page C and then hits the back button 2 times, changes something in form A and submits it. We actually have a merge of page C with page A. This is a problem and this is where a continuation framework comes to the rescue.
It holds some kind of version of the submited paged and if you your back button a couple of times and then submit the serverside object’s state will correspond as if you had never gone any further in your workflow. You actually went back in your workflow.
He also explained that you can define flows. Let’s say you have a OrderFlow,SearchProductFlow and SearchCustomerFlow. You can start your OrderFlow and when you come to the state where the product should get added you leavy your OrderFlow and start a subflow, the SearchProductFlow. Once this flow has finished (and the user has his selected products) we return those products into the OrderFlow and we go on from the point we left it. You then go a couple of steps further and come to the point you have to select a Customer, then you start another subflow, SearchCustomerFlow,… you get the point.

I’m not quite sure, but I believe Ruby on Rails also has this feature. I bet there are more projects out there that do this, but in Java this was rather hard to do. until now offcourse

On another note I was talking to a friend of mine, I told him I was going to give a talk on Hibernate. He told me would have loved to join, but it was an internal workshop. I talked to my boss about this and kinda proposed to make a more open thing. Something like a jug. I know we have Bejug but I haven’t seen much events off them and on their site isn’t much info about them, therefor I would like to ask if any of the readers of this entry who are interested in joining such a jug would send me an email (fix dot pczone dot be). who knows if we can get a small community together we could actually do a session at least once a month. Probably in the future 1 topic per session will be done as 2 topics were really to much 🙂

So Axel or Tom who’s next 😉

Istanbul

As I like everybody like screencasts, I fiddled with Istanbul. Seems it has some problems recording my desktop. My guess is, it’s because of my ati pci-express videocard that wasn’t supported when I configured my X. Congrats to the team of Istanbul, I like your product. It makes screencasting really simple, and It even records in Theorra. What could a guy want more 🙂 (hmmm, maybe sound?). In combination with java applet of the fluendo guys that really makes a kick ass combo for doing demo’s and tutorials. As the people over here are also giving demo’s and tutorials I’ll show them the nice features of the opensource applications and who knows maybe they’ll even buy support.

I really need to follow up on my videocard support, maybe by now it is supported and I can run Xgl without my X crashing after 5 minutes 🙂

Eclipse Callisto

As some of you might know, there is a new version of eclipse out. Well together with that version came some other eclipse projects. One of them was BIRT (Business Intelligence And Reporting Tools) well I think it’s really amazing. If you don’t believe me checkout this screencast and tell me I’m wrong!! Actually funny as at the moment we are doing a Crystal Reports integration and I had mentioned Jasper Reports here (an java opensource reporting tool), guess they have a strong competitor on the market. Let’s hope they push eachother to the limits and the community will only benefit from it!! To bad we still are working here with Crystal Reports, believe me I’m trying to convert everybody to opensource.

UPDATE
my bad, callisto is the name of all the projects combined 🙂
END UPDATE

Totally unrelated, I’ve been very very busy the last couple of weeks. I’m trying to get my needed capital to start my own sweet BVBA or better EVBA. On saturday I hope to get the approval for renting a nice 2 bedroom appartment in Leuven. If everything goes well, I’ll be having a lot more spare time in a few months and I can finally can help some projects I like but don’t satisfy my needs at the moment. I maybe sound stupid but I always get the feeling I’m not doing enough for the oss, I’m spreading it everywhere I come, I submit bugreports, now and then a small patch nothing fancy yet. I even set myself a goal “for every company I’ll work for, I have to at least introduce 1 opensource project”. But I hope to have achieved much more in a year from now, probably one of the first projects I’m going to take a look at is Diva. If you don’t know Diva go check it out!!

Eat your own dogfood

Well yesterday I told someone, I mostly use the eat your own dogfood rule. Well for most parts I really do that, but today I had to use our webinterface for sending mails. Well we are using roundcube and because I mostly use rich client appz, evolution and thunderbird I haven’t used roundcube that much. Well as I already mentioned today I had to and boy do I hate it now. At first it seems really nice and smooth, you have drag and drop, everything is ajax (buzzword alert!!) nice nice nice. I wrote a mail +60 lines, I hit the send button and I got the alert your session has timed out!!!! Okay hit the back button nothing, again back, still nothing. After hitting that back button like a maniak I realized I had to rewrite my email and believe me that sucks!!! I pulled up my scite editor wrote it in there and copy pasted it into roundcube.

So task for this evening, setup squirrel and imp mail. Maybe even try the new jboss callobaration stuff as the vidcast seemed nice. To bad you have to have the new flash 9 beta installed.

So all suggestions for other good webmail clients are welcome!!

Podcasts and vidcasts

As you might know, I listen to a lot of podcasts. Here you’ll find a list of the podcasts I listen to, hope you’ll start listening to them 2

javaposse : podcast on java
the linux link tech show, podcast on linux
lugradio, another podcast on linux
php architect, podcast on php
linux questions, podcast on linux
software enginering radio, podcast on software enginering
jboss, podcast on jboss stuff
ubuntu podcast
novell podcasts
eclipse podcasts

My vidcasts

hak5, vidcast on everything geek related
podcasts and vidcasts on jboss

Continuous Integration

As the first deployment has gone to it’s dot O pains I had some time to setup a nice continious integration environment. As the application I redesigned had been working for a couple of years, and mine probably will 2 continious integration is almost a must.

In the past I already had read some books on this matter, and in those cases they mostly opted for cruiscontrol , an opensource framework (ffcourse). So yesterday I did the setup, except setting up the automatic checkout from CVS everything wen’t flawless. Except some usecases that weren’t up to date with the data in the db. (I know, I can use dbunit for doing that, but don’t think that’s necessary).

Today I’ll be fixing my testcases, as I only ran the fast ones for a while (as the whole testsuite took much to long). Well with this in place I can sleep more safely 🙂 Now subscribe to the RSS feed and off we go! I forgot how nice it is to have an environmnt in your back that checks everything you ever wrote. So for you peepz who don’t know what I’m talking about, go read up on it!!!

PS as On my work I’m on a win machine, I’m giving flock a go, this is blogged using flock so i’m rather interested in the result 🙂

Blogged with Flock

A screenshot :

cruisecontrol

Strength of opensource

Friday I had a performance problem at work. We were using hibernate to do all the DAO for us, so no Select statements. We optimized a view for faster retrieval of the data, but it still took the application a long time to retrieve a large resultset, a small resultset went fast. Okay let’s do a small testsetup to very this issue, in the small testcase (1 mapping onto the same view) it was fast. Hmm bizar, okay let’s try it back in the application. Again slow, hmmm very odd!?

Okay what now, go to #hibernate on freenode and ask their. They told me to check with a profiler. So I did, hmm even more bizar. There wasn’t any extra cpu performance or memory usage. Wait, what’s this. The normal jdbc drops his cpu for a very short time (waiting for the database response) while the problem use case waits 10 seconds longer. Hmmm, okay how do we solve this. Well if you download Hibernate you get the source for free.

Okay put the source into our project and start debugging. After some time, I came to the conclusion that in our application the PreparedStatement.executeQuery() that just returns the Oracle cursor takes +10 seconds while in the testcase it only takes 1 second or less. So if we enable all the hibernate mappings something in the Oracle jdbc driver goes insane. Well for now I retrieved the java Connection object and perform the query myself. But I sure hope the guys over at hibernate or oracle can tell me what the problem is. Just imagine I had to debug this in a closed source environment, I’ld prolly still be waiting for them to create a use case like ours. 🙂

GO OSS!!!! 😀

mythtv finally!!

This weekend, I wanted to setup my mythtv box, I had planned already a couple of times, but almost everytime something came up. Well this weekend, I almost locked myself in and started it using the knoppmyth cd. Peace of cake you would think!! Well actually if you know what you’re doing, yes, otherwise no!!

First I had some very strange hardware issues. The computer I wanted to run it on was a used pc I bought half a year ago. Well I put in a 180 Gig hd instead of the small one that was in there first. The strangest thing happened, the hd was primary master and the cdrom was secondary master. The freakin thing wouldn’t recognise the hd. Okay unplugged the cdrom, k now it worked. Plug it back in, and same problem not recognised!!
Okay put the cdrom on slave, hd detected, but cdrom not? :s Okay put them on the same ide hd master with slave, cdrom slave (even cable select), none got detected? Finally I tried a new ide cable for my hd, the cdrom on another cdrom and the final thing I changed was I removed the plug on my hd. It was set in master with slave (there was no master only option). And finally this worked, okay already a couple hours lost 🙁

Then first install, but I remember from our lug meeting that knoppmyths be support was very poor. So I downloaded all the scripts, to bad I was running a different version then the scripts were for. The channels.sql script dropped the channels table and the whole thing blew up (hmmm, no backup of mysql made, pffff, restart).
After some hours testing and breaking it, I came to the simplest solutions thus far. Install the knoppmyth, scan for your channels. Use the guide.xml for the tv guides and then start renaming your scanned channels to the ones the tv guide has. Now my myth box is setup, I already recorded a csi miami and temptation island show 🙂
I still have to do some reading as the shows both are an hour and are 2 Gig in size. I did find a xvid option somewhere, well that’s for another time.

A funny note, my girlfriend isn’t always interested in my it stuff, but I showed here this thing and after 5 minutes I got a list of stuff I had to record for here. 😀

togetherJ

Here at work they payed quite a bit of money for Together J. This is an uml environment based on eclipse. They want it to reverse engineer some of my implementations. I already made a sequence diagram using Dia before the project started, this took me about half an our. Now that the code is finished you would expect that this would go much faster as Together J has a reverse enginering feature. Let me say that for removing,moving and unlinking of my diagram took me more than an hour thusfar and I’m not yet finished. Just wanted to do a shoutout that I really really dislike TogetherJ, this kind of tools give java the name that it is slow. While it’s actually not (okay, the startup of the vm has to be included in each app, but once started it really isn’t slow. Really, BUT don’t use it in places where you shouldn’t. Modelling in my eyes is a very graphic intensive thingy,and java isn’t there yet, maybe if they used java3D (may they even use it, don’t know the status of java3D). If you really want to do this you have 2 options imho, do it the mono way then, create a c or c++ object that can do native drawing and create some bindings for it, but then you get the problem of java not being fast going outside the jvm OR just fix the freaking drawing in java and give it a performance boost. Maybe this is already faster in the next editions of j2se, maybe it isn’t really that slow in 2d, but then it’s even worse that would mean that the people over at Borland can’t program and I find that hard to believe!!!

I’m trying to persuade my boss here to use pvanhoof his generator and build some reverse enginering features into it. Let’s hope he goes for it, I did say his code was (L)GPL so all features would have to be commited back to the code.