In my experiencing using NHibernate (the .Net Hibernate port); table locks
are never taken, its locks are handled through transactions (row locks etc)
- and cluster supports transaction isolation.
Are you sure table locks are being used? I would imagine that unless you
explicitly ask for table locks, Hibernate will be using transactions as well
to manage concurrency/isolation.
From: Diego Martínez [mailto:tabarem@stripped]
Sent: Wednesday, 9 February 2011 6:16 AM
To: Frazer Clement
Cc: Wagner Bianchi; cluster@stripped
Subject: Re: Hibernate - locking tables
Ok. I understand how it works. Thank you very much!!.
Best regards, Diego Martínez
El 8 de febrero de 2011 09:01, Frazer Clement
> Hi Diego,
> Ndb Cluster has row level locking. Transactions take row locks before
> updating or deleting existing rows. Two transactions attempting to update
> the same row will be serialised by the system. The second transaction
> see the effects of the first. The final effect will be as if the
> transactions were run in some serial order.
> I am not sure how / if Hibernate uses table locks directly, or just
> expects that the DBMS 'somehow' avoids races between different users. If
> uses Table locks directly, and is using them for some purpose other than
> serialising updates to the database, then this may not work with Cluster.
> If it just expects that the DBMS present a consistent view of the
> and serialises competing transactions, then this can work fine with
> Perhaps if you can explain how/why Hibernate uses Table locks, then we
> determine whether or not it will work unmodified with Cluster.
> The 'Single User Mode' which Wagner Bianchi mentions is probably not what
> you want to use, except on very rare occasions (e.g. DBA maintenance
> Diego Martínez wrote:
>> Thanks for your response. My question are what happens when several
>> update the same tables. For example, if I have a web service application
>> where multiple threads are updating the product table and no exist table
>> locking, the result would be completely unexpected. Each thread would
>> the same table, but in a different node?. What would be the end result?.
>> Best regards, Diego Martínez
>> El 7 de febrero de 2011 12:52, Wagner Bianchi
>> Hi Martinez,
>>> I understand the unique and efficient way to lock tables on MySQL
>>> SQL NODES is using "SINGLE-USER MODE". LOCK TABLES [WRITE | READ] will
>>> as expected, but, using only one SQL NODE. You'll LOCK TABLE t1 TO WRITE
>>> SQL NODE 1, but your application will can access the same table through
>>> SQL NODE 2 and write to that table.
>>> Let us know more about your project and perhaps we can help you.
>>> Best regards.
>>> Wagner Bianchi
>>> 2011/2/7 Diego Martínez <tabarem@stripped>
>>>> Members of the list have experience using MySQL Cluster through
>>>> am worried, because I understand that MySQL Cluster does not support
>>>> tables for example.
>>>> Do you know design patterns to use this new engine?
>>>> Best regards, Diego Martínez
> Frazer Clement, Senior Software Engineer,
> MySQL Cluster / Oracle - www.mysql.com
> Office: Edinburgh, UK
> Are you MySQL certified? www.mysql.com/certification