Redis vs MySQL comparison

http://www.mysqlperformanceblog.com/2009/08/27/looking-at-redis/ Interesting read, even though possibly biased

Hibernate & mysql5 dialect: just frightening…

did you know? http://opensource.atlassian.com/projects/hibernate/browse/HHH-468. Note that this issue (like some of my favorite) is now open since 2005.

InnoDB checks UNIQUE and FOREIGN KEY constraints row-by-row

Hi For my first post here, let me speak about this issue which bogged us down a few time ago : InnoDB checks UNIQUE and FOREIGN KEY constraints row-by-row It may sound trivial, but it means that unique and foreign key constraints aren’t transaction safe. But, when using some ORM like hibernate, it’s pretty easy [...]

Migrate Data from Postgres to MySQL

if you ever come to the need to migrate Data from Postgres to MySQL, you should stay away from using dumps. It is a hell lot easier to use export/import to/from CSV Data, because you do not need to synchronize column-names and it is special-char-proof. Postgres syntax for exporting: COPY tablename [ ( column [, [...]

Heap troubles with MySQL ConnectorJ

Just a quick note about a problem i had to face few days ago. After updating a System from mm.mysql version 2.0.14 to the current Connector/J, i recognized ‘sudden death’ by OOM of the JVM After a few days of uptime. Long story short, reason for that was a memleak caused by legacy code, that [...]

Hibernate and IndexColumn

As you might know already, Hibernate adds an important non-Spec Feature to the JPA: ordered List Mappings . It is used as easy as: A.java @OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) @IndexColumn(name = “sort” , base = 1) private List<B> b = new LinkedList<B>(); The good news is: Hibernate preserves the order of [...]

EJB3 Entity-Relationships

Had some fun with EJB3 Entity definitions today, that showed a pitfall of “Quick-and-easy-don’t-think-about” relationship definition.Situation is as follows: A.java @ManyToMany(mappedBy = “a” , fetch = FetchType.LAZY, cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE}) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) private Set<B> b = new HashSet<B>(); B.java @OneToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) private A a; The error is quite easy to spot [...]

MySQL esoteric DELETE FROM Syntax

I had a little problem today using DELETE statement in MySQL. I wanted to delete those rows, unreferenced by another table. So what comes to ones mind is using a subselect like DELETE FROM table1 WHERE table1.primaryKey NOT IN ( SELECT referenceToTable1 FROM table2) unfortunately the deployed version of mysql did not allow subselects. In [...]