JPA EntityManagers

27 01 2009

Been having problems with JPA EntityManagers recently in K2 as we didn’t realise they should not be shared between threads. Fortunately fixing this in K2 doesn’t require very much. Create a proxy to a thread bound entity manager contained within a ThreadBound holder. When these are put into a request scope cache from the CacheManager, the ThreadBound.unbind method is called when the request ends, so we have a hook to perform commit and close down on the EntityManager. The really nice thing about using a Cache from the CacheManager is that it can also be created with a Thread scope rather than a Request scope. In Thread scope, its not unbound… so by changing one switch we can, if the JPA usage is well behaved move from a per request to per thread binding. Fortunately the overhead of creating an EntityManger from most JPA providers is < 1ms.. and with this approach, we don’t need to create it on every request.

Advertisements




Kernel Update

26 01 2009

That ssounds like a security patch, but its not :). The Sakai Kernel work is moving forwards. We have a demo server up and running with the UX work on top of it and should soon have Content Authoring functional. We have tested some of the aspects. Loaded 5000 users, a bit slow at the moment, but then we dont have any indexes in the DB. 0.4s per user. We have tested webdav, which looks just fine with 2G of files form 1K to 100K in side, and done some tests with large files > 1G. So far so good. The best bit appears to be it is quite happy in 64M of memory and starts in 12s.

This week I hope to get the site services sorted out (perhase today). We have had Carl Hall from GATech and Jon Gorono form UCD over in Cambridge which has helped immensely to make more progress, share thoughts and learn from each other.

There is more to come as this ramps up.





What not to do at an Airport ?

4 01 2009

Easy… arrive 5 hours after the plane takes off on New Years Eve… in Sydney… bound for London with no flights going out :). That’s what I did, oops. My family, who were with me were not that happy, but the consolation was we saw the fireworks on Sydney Harbour Bridge.

How did it happen ? An SMS was sent from the carrier (Singapore Air) telling me the flight time had changed, what it didn’t tell me was that this was the connecting flight from Singapore to London, and I didn’t check. Perhaps they should think through their UX a bit more and the impact of a small screen on the information they are trying to deliver. I will check next time.

What happened next? Well I was expecting a complete nightmare, but although this was entirely my fault (so I had no right to rant, and didn’t), and there were no seats available until 12 days later, a very nice bloke at the Sydney Singapore Air office (Davin he said his name was) got us all onto a flight 24 hours later, and we didn’t have to wait on standby at the airport. I guess some lucky person got bumped up to business to make space for us. 24 hours later, having done some work, watched a few movies and one embedded Linux reboot from the onboard video system (A380’s have 1 CPU with a full IP stack and Ethernet port per seat running a Linux kerne and every seat has 110v, if only I had a network cable) we arrived in London, tired, cold but very grateful to Singapore Air. The only shock was the temperature difference. 30C.