Strange Loops

No Matter Where You Go, There You Are

Oracle to Mysql Gotcha

| Comments

At the new job, we use MySQL. I’ve mostly worked with Oracle before this and while not expecting everything to be the same, the transition has been smooth.

The one gotcha that threw me for a loop is MySQL’s default transaction isolation level for. With Oracle, once data is committed, it’s available to be read by all other connections. With MySQL, your view of data is determined by the first query made after the connection is open.

One rationale (I was given) is MySQL has fast connection setups and connections are setup and torn down between queries. I’m not sure I believe that though….

The solution was to change the isolation level for my session via the following incantation:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED


(Taken from the mysql reference manual page)