Reiser talks
Remember Hans Reiser, of ReiserFS fame? Supposedly he killed his wife, though the body hasn’t been found (yet). He’s currently in jail awaiting trail, Wired has an interview with him which is quite interesting. Get it here.
A viewers view
Remember Hans Reiser, of ReiserFS fame? Supposedly he killed his wife, though the body hasn’t been found (yet). He’s currently in jail awaiting trail, Wired has an interview with him which is quite interesting. Get it here.
The european lauch of the Playstation 3 was less than a resounding success, or so I’ve head. The initial batch of consoles doesn’t even seem to have sold out yet. That must really hurt Sony.
I can’t say I’m really surprised by this actually. Have you seen the cost of the new console? It’s 599 euro’s, and the games are about 70 euro’s. But of course the costs don’t stop there. In order to really appreciate the new console, you’ll need to buy a decent HDTV, setting you back another 1200 euro’s or so on average. That’s a pretty steep price, and it’s probably also the reason the WII is doing so well right now. It’s cheap, fun, new and you don’t need any additional new hardware to show it of.
The discussion about games and there influence upon violent shootings etc. has been going for years now. Recentently I came across an account at the penny-arcade. It’s a unique perspective on this topic, by one of the parents of the instigator of alleged computer influenced violence. You can find the post here, it’s pretty intense.
Personally I’m not a big believer of the influence of games on violence. I’m pretty sure that if computers weren’t around, another excuse would be found. Seriously, if the influence was this big, the should be a huge problem right now. Millions of people around the world are playing these games, and don’t feel any urge to shoot someone head to smithereens, just because they could do it in that game…..
Due to security issues etc. I had to update the wordpress install and immediately decided to change the layout of my blog. I wasn’t entirely happy with the previous one, it was a bit to narrow and cluttered. I think the new layout is much better, very clean.
Hope you like it!
In my current project at work we’re using the compass framework to meet our searching needs. All in all it’s a great framework with lots of support to specify your search indexes and neat integration with Hibernate/Spring (which we’re also using). Besides the wrapping of lucene in order to simplify the searching, it also comes with a JdbcDirectory implementation of the lucene Directory to store indexes in the database. In order to make sure that the index is always in sync with the data in the database, this is really cool, and you only need one backup for everything.
However….. the last couple of days we were running into serious problem with the JdbcDirectory implementation. At random times during the indexing etc. the directory would throw SqlExceptions with the following error message (using PostgreSQL):
ERROR: Invalid Large-Object descriptor: 1183
and the whole transaction would come to a grinding halt. With the system going to test, these errors were becoming more and more serious and I’ve spend days (literally) together with my collegue tracking down the problem.
When databases start throwing these kinds of exceptions, it generally means that you are trying to acces the Blob within an invalid transaction context. Therefor I checked all our settings concerning transactions within spring, and it turned out that we had indeed made a mistake there which caused the compass process to not correctly participate within our spring transaction management.
Breath of relieve…..
But, after a brief elated feeling, the errors were starting to occur again. NOOoooooo, this was turning out to be a major pain, I started to believe that the problem might somehow be related to postgres blob logic, which might be bugged. It’s really amazing how little info you find on google if you search on the error message and the information that you do find turn out to be irrelevant. Then I spotted in the PostgreSQL blogs that the autovacuum process was logging during the same time as the error message above. AHA, that must be it (you’re getting this, right?), I turned off the autovacuum hoping that it was somehow responsible for the problems we faced. Started the test again and it seemed to be running longer….. CRASH, NOOOooooo. Well that wasn’t it.
Today, I finally cracked the problem, and it was with compass. Compass uses an algorithm to cache blobs during a transaction (don’t ask me why I did not spot this sooner) and it’s broken if you’re using spring transactions. You see, when integration with a Spring managed transaction, the documentation specifies that in order for the JdbcDirectory to be ran in the same transaction as the Spring managed ones that Hibernate etc. use, you have to use the TransactionAwareDatasource from Spring. This datasource deals out connections using a ConnectionProxy, which is a new Proxy around the current Connection that holds the transaction. Two calls of getConnection don’t return the same Proxy, however, they return a new instance.
The caching mechanism for blobs actually assumes that the connection object is a good way to determine the keys for your blob cache, but when the connections don’t have an equality match this will not work, meaning that you frequently don’t get a cache hit on your blob. Besides from being a performance hit, it’s also a problem because chances are high that at the end of the indexing operation the blob cache is not cleared, but remains in cache. From here on out it’s just a matter of time before a connection a few transactions later on does match the cache key and old blobs get returned from that cache, which have an invalid handle by now, since the originating transaction was already commited.
I’ve patched it, not very pretilly, in our own compass version (using 1.1 by the way) within the DataSourceUtils, but I’m hoping that this will get fixed pretty soon within the compass framework as a whole. I can imagine other JdbcDirectory users also running in to this problem. Right now I’m just really happy I found the problem, because I was starting to get to the point were we had to decide to stop using it and use a different (file based) sollution. Yah!!!!
I’ve not posted here for a while, I actually planned to create the image upload applet for wordpress in my free time, and keep you updated of the progress here. The only problem with that is: I haven’t done any work on it since the last post. Don’t worry though, I’m sure that I’ll pick it up in the near future. The only problem is, I’ve recently been reintroduced to gaming! The culprit:
Europa Universalis III
It’s a semi historically correct sim of the world starting just before the colonization of the new world (1450 or therabouts). It’s really fun to play because it allows you all sorts of ‘what if’ scenarios. In my current game as Scotland I’m trying to be totally historically incorrect. I’ve already reduced England to a shadow of it’s former glory and I plan on annexing then soon. I’ve taken over all of Ireland and I’ve started colonizing the new world, taking over the Aztec, Maya, Zapotec and Inca lands. I’m a huge, unstoppable, force right now. Clan McBult Anyway, for some reason the game has an immense draw on me, I’m spending all the free time I can find on it while trying not to neglect my wife and son.
I’ll try to post some screenshots of my current game here, for my own amusement.
Greetings and till next time.
To balance my previous post somewhat, besides creating an editor for images, I’m also creating an imagebar with thumbnails. The image bar can be used to drag imagefiles into and to select the image that you want to edit. I have to say that, using ImageIO, it’s really easy to implement this. All you have to do is extend from JComponent and implement the paint() method to have the image drawn. Because of the way Java2D works, there is no need to figure out the coordinates of the image, it’s always relative to the component so you just use (0,0). With some fancy rendering of higlighting when mouse overed and a delete icon that pops when hovering it’s starting to look really nice:
I’ve been trying to write a simple applet for rescaling and rotating images prior to uploading them to wordpress, but the way in which Java2D works with images really really REALLY! sucks. There is just no way to easilly get what you want. Right now I’m seriously contemplating just creating all the logic from scratch….
So, I ran into a nasty little problem at work when trying to cluster the hibernate second level cache. We were using hibernate 3.2.1 GA and ehcache 1.2 and when replicating the caches between multicast nodes, random classcast exception occured when retrieving an object from secondlevel cache(slc). Turns out that the problem was with the way hibernate stores it’s objects in de slc, by default it stores the attribute values of the properties in an array, this array gets replicated to the various nodes. Normally this would not be a problem, but it seems that the order of the properties as determined by hibernate for persistentclasses (using annotations) is not fixed between SessionFactories. This caused the classcast exceptions, because where one instance inserted a String, the next instance expected a Date or Long or whatever.
We’ve even tested this by deploying the same WAR file on the same machine (same tomcat etc.) the problem will still occur. There is a way around this problem, luckily, it took us a while to find it:
If you set the hibernate property hibernate.cache.use_structured_entries to true, hibernate will use a HashMap to store attribute values by their property name. This way, the retrieval of the properties is guaranteed, even when the order of the properties isn’t. I’m guessing that this problem only affects hibernate when using annotations, since otherwise the order of the properties is already set in the XML, but I’ve not tested it.