Monthly Archives: August 2004

Transation Isolation Levels


Discussing with a colegue about defining transactions in our application we finished by talking about transaction isolation levels and finally I got into problems explaining the problems faced in concurrent transactions (I wasn’t able to tell the difference between non-repeatable and phantom reads [sigh/]). I decided to write down for further references.

Transaction isolation levels are defined according to the state of data during the following 3 scenarios (they compair the data accessed from 2 different transactions):
* dirty reads
occur when a transaction reads data written by concurrent uncommited transaction;
* non-repeatable reads
occur when a transaction re-reads data it has previously read and finds that data has been
modified by another transaction (that committed since the initial read);
* phantom read
occur when a transaction re-executes a query returning a set of rows that satisfy a search
condition and finds that the set of rows satisfying the condition has changed due to another
recently-committed transaction;

Note: even if it seems that non-repeatable reads and phantom reads are the same thing, the difference is made from the fact that in the 1st case the same rows are returned but their data is modified, while in the 2nd case another set of rows is returned.
Defined isolation levels:

DB Isolation Level Dirty Read Non-Repeatable Reads Phantom read
Read uncommitted Y Y Y
Read committed N Y Y
Repeatable read N N Y
Serializable N N N
Java Level Dirty Read Non-Repeatable Reads Phantom read
TRANSACTION_NONE Y Y Y
TRANSACTION_READ_UNCOMMITTED Y Y Y
TRANSACTION_READ_COMMITED N Y Y
TRANSACTION_REPEATABLE_READ N N Y
TRANSACTION_SERIALIZABLE N N N


Still I would like to see more details on the separation made on non-repeatable reads and phantom reads.

Advertisement

Leave a comment

Filed under Uncategorized

Are you gonna test you java GUI?

If yes pay a visit here: TRIJUG Wiki: TestingGUIs. A non exhaustive list, but you may find what you are looking for.

Leave a comment

Filed under links, Tools

Becoming an Architect

Becoming an Architect
Luke Hohmann: Most people think of architecture as technical, and the architect as a technical person. And absolutely, the architect must be technical. But there’s also a social aspect of the architect role that I think is not well communicated or understood. The architect is the person who will say, ‘This is the way we do things.’
[…]
Conversely, you can tell when a system hasn’t had an architect, because it lacks consistency in things like error handling, naming, and so on. In a system I’m working on right now, for example, I noticed that some of the database tables have a unique identifier column named id, other tables have a unique identifier column named id, and other tables do something completely different. So table foo would have a fooid column, and table bar would have an id column. I finally went to the development team and said, “Let me guess. You’ve had more than one DBA [Database Administrator] in your time here.” And they said, “Oh yeah, we’ve had five of them.” Every DBA had their own way of naming columns. They didn’t have an architect to ensure a technical consistency in column naming. There wasn’t a notion of conceptual integrity from a technical perspective.
[…]
Humans are failure machines. We’re not success machines. We’re failure machines. We fail all the time. And it’s only through processing the feedback of our failure that we learn how to correct for them and do better. That is why it is important to stick with the choices you make and understand how well they worked.

Leave a comment

Filed under personalog

LGPL your project on…

Assuming you are intending on using Java and a license like LGPL then here are some choices.

This list was created by some other blogger to who I must thank. Unfortunately I have lost the original link so I excuse myself in front of him [sorry/].

Leave a comment

Filed under personalog

My beloved Eclipse 3.0M9 plugins

I saw that there is some kind of trendy movement to publish the piece of software you like best and use on daily basis, so here there are the Eclipse plugins I use (in fact I’m writing them here to have the links to access them directly 🙂 ). – AspectJ and AJDT: I am a newbie in the aop but these tools help me a lot, and from their community I already learn very valuable ideas – SQLExplorer (former known as JFaceDbc 2.2.1) branched from original JFaceDbc (which got now to version 3.x) – XMLBuddy: no comment (the best in XML). I saw also but this one is not free [sigh/] – ImplementorsJava2HTML: i use it mainly for code reviewing in conjunction with Jupiter – Jagzilla: the plugin I have just patched (now is running really smooth – there can be done more improvement, so I hope I’ll have some more hours to put into it) – Profiler: use it from time to time (still I haven’t got the opportunity to test it under 3.0M9) – Jupiter: the best tool for code reviewing (I patched the last available version to work with 3.0M9, and from time to time I put some little time on fixing bugs) – Eclipse Wiki: I like very much the idea of Wiki, and a personal one is the best to keep my thoughts all together – CodeSugar: old buddy CodeSugar that gives you a nice and clean equals, hashCode, and some other methods implementation. – Colorer-take5 library a little more color in your Eclipse [smile/] – AT-Project: just got broken on my installation. Hope it will be back soon, as I put inside it a lot of my and my team stuff. If you have another you love please let me know.

Leave a comment

Filed under Uncategorized

freshmeat harvest – part 1

This is the first part of a long harvest time on freshmeat announced projects:

* Linux

* Java

* Misc

Leave a comment

Filed under links

Tomcat – JRockit

Found this on this weblog: Random thoughts:

Turns out that it wasn’t Tomcat 5 that provided the 15-20ms/page performance. Instead, it was the JRockit 8 JVM that did the trick. I got the same performance with Tomcat 4, but switching to Sun JVM /w server settings increased the rendering time to about 40ms/page. Oh well.

I definitely must try this.

Leave a comment

Filed under Uncategorized

Manageability quoting Rod Johnson

Manageability – Rod Johnson on J2EE Without EJB:
An interesting listing of EJB offerings and their utility:

  • Declarative Transactions: Good but not always appropiate.
  • Remoting: Best choice today for remoting.
  • Clustering:Entity and SFSB have weak implementations.SLSB clustering isn’t rocket science. Clustering more important on the web and database tier.
  • Thread Management:Locking entire bean instances is naive. Multi-threaded services without read/write instance variables make better sense (i.e. Servlets).
  • Instance Pooling:Doesn’t make sense with today’s more modern garbage collectors.
  • Resource Management:Not truly tied to the EJB container.
  • Security:Security requirements tend to be more complex than what EJB role-based security provides.
  • Business Object Management Use of JNDI unnecessarily complex.

Leave a comment

Filed under personalog

NoCo first version

A short update on the previous post. I have already finished the first version of the CoNo plugin extension. I have name it NoCo :-). I intend to send it to the initial authors – in case they are still interested in it (they are not active for the last 2 years, but who knows). Otherwise I will try to find a solution to post it somewhere.
I will come back with the features description of the current version.

Leave a comment

Filed under personalog

Holiday plans

I’ve been in holiday for one week and a lot of plans have risen into my mind. I will present here shortly:

  • Eclipse CoNo plugin extension: to save notes files to a specified (per project) directory – this allows not to save the notes into cvs or to have to add lots of .cvsignore files
  • Eclipse Protocol plugin extension with javadoc tags: this will allow the same functionality as the original plugin, but will not force you to reformat the sources in order to take advantage of it
  • Aspectwerkz code digging
  • Aspectwerkz ajdoc implementation
  • Spring framework fullblown demo

I also intend to start and finish reading Hibernate in Action as I consider it one of the most interesting frameworks (and not just interesting, but very very usefull).

I think I have lots of plans for only one week left for my holiday.

Leave a comment

Filed under personalog