FAQ Database Discussion Community


Does using ReadWriteLock inside a synchronized method make sense?

java,locking
We have some code that implements a cache. All of the methods have the synchronized keyword, and also use a ReadWriteLock internally. Simplified example: private final ReadWriteLock _rwLock = new ReadWriteLock(); public synchronized void setItem(final UUID id, final Object someObjToCache) { try { _rwLock.writeLock().lock(); _innerCache.set(id, someObjToCache); } finally { _rwLock.writeLock().unlock();...

Is it possible that a file lock never gets released?

java,locking,release,jvm-crash
Given the following file lock request: FileLock lock = null; try { lock = randomAccessFile.getChannel().lock(0, Long.MAX_VALUE, mode.shared); // work with file } finally { if (lock != null) { lock.release(); } } The targetted OS being MS Windows, is there any chance the finally block won't be ever executed, and...

Synchronization of property access with Class Lock

c#,.net,properties,synchronization,locking
Please consider the following code public class DataModel { public int a { get; set; } } public static class StaticAccess { private static _Data = new DataModel(); private static DataModel Data { lock(_Data) { return _Data; } } } Will an access to property a such us StaticAccess.Data.a =...

Using a condition instance with a lock

java,multithreading,concurrency,locking
What happens when a condition is associated with a lock like this: Lock lock = new ReentrantLock(); Condition notFull = lock.newCondition(); An example would be the bounded buffer class such as here So when, for example, the methods notFull.await() and notFull.signal() are called, what is being waited on to be...

Why does MVCC require locking for DML statements

postgresql,transactions,locking,dml,mvcc
In PostgreSQL, the MVCC concurrency control mechanism says that: MVCC locks acquired for querying (reading) data do not conflict with locks acquired for writing data, and so reading never blocks writing and writing never blocks reading So, even for READ_COMMITTED, an UPDATE statement will lock the currently affected rows so...

Keep batch file from being edited

batch-file,passwords,locking
Can I lock or set a password to a batch file/script, I have made a script but I don't want people on my work to change it. They must be able to run it but not edit it. Is this possible and how? I have search for it but I...

flock(): is it possible to merely check if the file is already locked, without actually acquiring the lock if not?

c,locking,flock
My use case is as follows: I have a program that enforces that only one instance of it can be running at any given time, so at startup it always tries to grab hold of a lock file in a standard location, and terminates if the file is already locked....

core dumped using lock in openMP

parallel-processing,locking,openmp
I want to parallelize function S and lock every node but I keep getting core dump. I'm trying to use a lock in every node of the graph. It will work if I use a single lock on my nodes. for (l = 0; l < n; l++) omp_init_lock(&(lock[l])); #pragma...

Running a scheduler on more than one machine

java,db2,locking,scheduling
I have a Java service which creates x games in the future every y seconds (calculating start time and end time for each of them) and inserts them into a DB2 table. The code basically looks for the end time of the last created game, if it exists and is...

MongoDB multi-granularity locking

mongodb,locking,wiredtiger
MongoDB uses multi-granularity locking [1] that allows operations to lock at the global, database or collection level, and allows for individual storage engines to implement their own concurrency control below the collection (i.e., at the document-level in WiredTiger). Besides I've read that there are two possible Storage Engines for...

How can I check Windows Lock settings?

c#,windows,winforms,locking,windows-screensaver
I have a windows form that needs to be able to check the windows screen saver settings (Is it active, is it under 15 minutes, is "on resume, display logon" active) Essentially if all of those are true the user gets a nice big PASS if not the user gets...

Java: best way to share Lock between different threads

java,concurrency,locking
Is it advisable to implement a extrinsic lock as an attrubite of a class that will be shared between different threads? For example I would like to have a implementation like this: public class Order { private final LinkedList<Food> order; private final int orderNum; private static int idGen; private final...

What does the exclusive lock on storage for OrientDB entail exactly?

concurrency,transactions,locking,orient-db
Having read the following statement from the official documentation of OrientDB: In order to guarantee atomicity and consistency, OrientDB acquire an exclusive lock on the storage during transaction commit. I am wondering if my understanding of the situation is correct. Here is how I assume this will work: Thread 1...

Python thread locking/class variable initialisation confusion

python,multithreading,class,locking,scikit-learn
I have a class which behaves strangely if accessed by multiple threads. The threads are started during sklearn's GridSearch training (with jobs=3), so I don't know exactly how they are called. My class itself looks roughly like this: from sklearn.base import BaseEstimator, TransformerMixin import threading class FeatureExtractorBase(BaseEstimator, TransformerMixin): expensive_dependency =...

How to add diagnostics to C# lock function for multithreading debugging

c#,multithreading,locking,mutex
Is it possible to shim the C# lock function, to add diagnostics? I would love to see whenever a lock is taken or released, the lock count, and the managed thread id of the thread taking the lock. In C++ you write your own Mutex class and provide your own...

What happens to PHP file lock if the script times out or is terminated while the lock was on?

php,locking,flock
My question is best illustrated with this PHP code sample: $file = fopen($filePath, "wb"); if($file !== false) { //Obtain exclusive lock if(flock($file, LOCK_EX)) { //Script times out or is terminated here //say, due to it using too much RAM, etc. //... //Release exclusive lock flock($file, LOCK_UN); } fclose($file); } What...

symfony2 doctrine 2 : in which cases do we need to lock a database table/row?

mysql,symfony2,doctrine2,transactions,locking
I have discovered a doctrine article about locking : http://doctrine-orm.readthedocs.org/en/latest/reference/transactions-and-concurrency.html?highlight=locking#locking-support I understand that in some cases involving multiple requests, there is a need to lock tables. It's not clear for me when do we need to do that. Can someone provide basic use cases where we absolutely need this? Or...

How to lock with ReentrantLock?

java,spring,locking
I would expect the following test to only print "has been locked" once. BUT it consequently prints the line. public class LocKTest { @Test public void testLock() { Lock lock = new ReentrantLock(); while (true) { if (lock.tryLock()) { //lock.lock(); same result if I include an explicit lock here System.out.println("has...

Any guidance of deciding a particular object for locking [duplicate]

c#,multithreading,locking
This question already has an answer here: C# lock statement, what object to lock on? 3 answers I have seen few different ways of using a particular object for lock construct. Have a dedicated private static local variable and lock on that private static object syncObj = new object();...

Postgresql function stuck in for loop

postgresql,loops,for-loop,locking
The function is stuck just before the loop. select * from scm_main.fn_connection_stations(1219646) The message "Start..." is printed but message "... end" will not print. CREATE OR REPLACE FUNCTION scm_main.fn_connection_stations(var_connection_id bigint) RETURNS SETOF scm_main.typ_connection_stations AS $BODY$ DECLARE var_affected INTEGER DEFAULT 0; var_row scm_main.typ_connection_stations%ROWTYPE; BEGIN RAISE NOTICE 'Start...'; FOR var_row IN SELECT...

Scope of synchronization on .class objects in the JVM

java,class,jvm,synchronization,locking
Let's say I've got the following code: synchronize (Test.class) { ... } Does this mean that the Test.class objects is locked for every other program running in the same virtual machine? Or does this lock only affect this one program in the JVM? If it affects every program: When Test.class...

Why do both the notify and wait function of a std::condition_variable need a locked mutex

c++,multithreading,c++11,locking,mutex
On my neverending quest to understand std::contion_variables I've run into the following. On this page it says the following: void print_id (int id) { std::unique_lock<std::mutex> lck(mtx); while (!ready) cv.wait(lck); // ... std::cout << "thread " << id << '\n'; } And after that it says this: void go() { std::unique_lock<std::mutex>...

How does a singleton property with a lock ensure thread safety?

c#,multithreading,design-patterns,locking,singleton
I rarely use singletons, in this case it's appropriate. While trying to investigate the best implementation thereof I came across this bit of code which has left me believing I improperly understand how brackets encapsulate a "scope." public sealed class Singleton { private static Singleton instance = null; private static...

Getting Apache Camel to stop retrying if failed to move the file after route completion

java,file-io,exception-handling,locking,apache-camel
The example route below picks up a file and performs a series of operations on them. Once completed, as noted in the camel:from field, the route is instructed to move the file to a .processed directory. Alternatively if failed, move it to the .error folder. The problem occurs when another...

What synchronization primitive should I use to implement a event driver framework in Java?

java,synchronization,locking,event-driven
I have a looper thread to execute tasks. Other threads can submit tasks to this looper thread. Some tasks are immediate tasks, others are future tasks, which are to be executed after T seconds after submission. I use PriorityBlockingQueue to store tasks, where time is used as the priority, so...

C# proper locking

c#,multithreading,parallel-processing,locking
Let's say I have such actions performed: A.B.C.add(new D()); A.B.add(new C)); A.add(new B)); Those actions are performed all at the same time. Imagine that these are in three different methods. lock(A.B.C) A.B.C.add(new D()); lock(A.B) A.B.add(new C)); lock(A) A.add(new B)); Are these locks independent? In other words - will these actions...

ReentrantLock not giving expected result

java,concurrency,locking
I have created a producer consumer program using threads (wait and notify) feature. The code is - /** * Message.java ( Common object ) */ package threads; import java.util.concurrent.locks.ReentrantLock; /** * @author chouhan_r * */ public class Message { private String message; ReentrantLock lock = new ReentrantLock(); ReentrantLock takelock =...

Tool to find cause of dead lock in Java application [closed]

java,locking,profiling,monitoring,deadlock
We can reproduce a situation where part of your system freezes. We suspect that this might be due to a locking problem. How can we find out where every thread of our application is currently at? Which tool can we use to find the spot where the deadlock occurs?...

JPA - Pessimistic Lock - What happens when the lock exists?

java,hibernate,jpa,locking
Background Info: I have an issue that is symptomatic of an entity update not going through. Reviewing my logs, I can see see the update sql statements that I expected, but they are almost simultaneous (0.012 seconds apart) and the application uses a pessimistic read lock when updating the entity....

Synchronizing data output stream

java,multithreading,locking
I'm having a problem where I have a class that gets instantiated upon a connection to server. The method I'm having trouble with in the class looks like so: public void sendData(byte[] dataToSend) throws IOException { sendLock.lock(); int dataLength = dataToSend.length; dout.writeInt(dataLength); dout.write(dataToSend, 0, dataLength); dout.flush(); sendLock.unlock(); } Where "sendLock"...

Unable to lock file using flock with file descriptor

linux,shell,concurrency,locking
First let me show what works. If I use flock with the file path, it works. Terminal 1: [[email protected] ~]# flock -x -n /tmp/foo.txt -c "sleep 100" Terminal 2: [[email protected] ~]# flock -x -n /tmp/foo.txt -c "sleep 100" [[email protected] ~]# echo $? 1 The above output shows that I first...

Will lock in while loop make variable unreadable

c#,multithreading,locking
Consider the following code that runs in thread B (that's all that runs in that thread): private void KeepValueCurrent(WaitHandle mre) { while (mre.WaitOne(50)) { var newAddressOffset = LengthOfLastLogEntry; if (newAddressOffset > _currentAddressOffset) { //Only update if new value is larger than existing lock(_locker) {_currentAddressOffset = newAddressOffset;} } } } Will...

Managing concurrency on store checkout process

mysql,concurrency,transactions,locking
I have been reading all day searching the correct way to manage concurrency within a e-commerce checkout process, and I'm still not sure how to develop it. Scenario User selects one product from the store, go to checkout page and pays using his credit card. The site process the payment...

How to perform file-locking on Windows without installing a new package

python,locking,pywin32,fcntl
I've added code to a Python package (brian2) that places an exclusive lock on a file to prevent a race condition. However, because this code includes calls to fcntl, it does not work on Windows. Is there a way for me to place exclusive locks on files in Windows without...

How to interpret mwaits output

c#,locking,sos,sosex,windb
I am trying to understand how can I use mwaits command things like type of lock, lock owner etc. I know that some of this could be done via sos commands but how can I use information below that I am getting with sosex mwaits command. 0:006> !mwaits Examining SyncBlocks......

Process/SPID is being blocked by itself, how to clear/kill without restarting Sql Server

sql-server,sql-server-2008-r2,locking,spid
We have a process that was running for 4 hours. Because it was running so long, it was causing other issues in the database, so it was decided to kill the process. Now, the process is in a suspended state. It also states that it's being blocked by itself after...

addAll() in LinkedBlockingQueue is thread safe (and solution if it's not)?

java,thread-safety,locking,blockingqueue
Quoting the documentation: "BlockingQueue implementations are thread-safe. All queuing methods achieve their effects atomically using internal locks or other forms of concurrency control. However, the bulk Collection operations addAll, containsAll, retainAll and removeAll are not necessarily performed atomically unless specified otherwise in an implementation. So it is possible, for example,...

TAS vs TTAS locking

performance,x86,locking,atomic,spinlock
I'm comparing TAS vs TTAS locking. Here are the code: TAS: .globl _tas_lock_acquire _tas_lock_acquire: repeat: lock btsw $0, (%rdi) jc repeat ret .globl _tas_lock_release _tas_lock_release: lock btrw $0, (%rdi) ret TTAS: .globl _ttas_lock_acquire _ttas_lock_acquire: try_lock: lock btsw $0, (%rdi) jc spinwait ret spinwait: btsw $0, (%rdi) jc spinwait jmp try_lock...

Do we need an mfence in the unlock() function of Peterson's lock on x86?

c++,c,locking
Peterson's lock code taken from (german) wikipedia: # define FALSE 0 # define TRUE 1 # define N 2 int turn; int interested[N]; void enter_region(int process) { int other; other = 1 - process; interested[process] = TRUE; turn = other; while (interested[other] == TRUE && turn == other) ; }...

Kernel spin-lock enables preemption before releasing lock

linux,linux-kernel,kernel,locking,scheduling
When I was discussing the behavior of spinlocks in uni- and SMP kernels with some colleagues, we dived into the code and found a line that really surprised us, and we can’t figure out why it’s done this way. short calltrace to show where we’re coming from: spin_lock calls raw_spin_lock,...

InnoDB Concurrent Read-Write

mysql,locking,innodb,read-write
I wanted to understand how InnoDB handles multiple simultaneous reads/write operations. Consider the below scenario: You are performing a pretty intense batch write. Any read request that will come in will have to wait till the batch write gets completed. During this time, write request are also requested on the...

Java combine explicit locks with synchronized methods

java,multithreading,concurrency,synchronization,locking
I have a thread safe class Container: public class Container { private int x; ... public synchronized int getX(); public synchronized void setX(int x); } Then I have a list of containers: List<Container> containers; I would like to iterate through the list, aquire the container's lock at each iteration and,...

ASP.net cache access causing Collection Modified exception in foreach loop

asp.net,linq,caching,locking,race-condition
Ok first things first. This is some exception information given by the support team. I know the line and code where it happens. It happens in a FirstOrDefault call over a dictionary obtained from cache. 1) Exception Information ********************************************* Exception Type: System.InvalidOperationException Message: Collection was modified; enumeration operation may not...

what are the use cases for std::unique_lock::release?

c++,multithreading,c++11,locking
In what situations would one use the release method of std::unique_lock ? I made the mistake of using the release method instead of the unlock method and it took a while to understand why the following code wasn't working. #include <mutex> #include <iostream> #include <vector> #include <thread> #include <chrono> std::mutex...

Can't type in text fields everywhere

twitter-bootstrap,locking,textfield
I was working on a client site but found a problem that text fields are locked or can't type in it, just looking good means blinking normally if you click on text fields (but can't type). A simple query but not looks like a simple one to me!...

How to make threads go through a gate in order using C#

c#,multithreading,order,locking
I have three threads and some part of the code can run in parallel, some parts are locked(only one thread at the time). However one lock needs to only let them in in order. Since this is a loop it gets more complex. How do I make this behavior? If...

How to correctly serialise thread access to a flag controlling a loop

c++,multithreading,c++11,locking,mutex
I have a function, f1, that contains a simple loop, which is controlled via a boolean flag. The flag is not written to inside f1. I have another function that clears the flag. The two functions are called on different threads. If I lock the mutex before entering the loop...

Is using locking mechanism in Threading program equivalent to executing the code synchronously rather then asynchronously?

c#,locking
Example code below uses the concept of locking. But that prevents it from giving parallel execution. So is the title of the question correct: Is using locking mechanism in Threading program equivalent to executing the code synchronously rather then asynchronously? Does same case apply for Threading.Monitor and declaring class with...

providing locks on shared resources

multithreading,locking
So i'm trying to get my head around threads using shared resources. The examples on c#corner (link 1) and msdn (link 2) provide basic syntax examples and some theoretical framing, so the basic premise of locking a shared resource for a process I understand. Now, my question is: When accessing...

How to write a IEnum thread

c#,multithreading,thread-safety,locking
I am trying to write a small threaded application and wanted to know how I could implement the below IEnum as thread/threaded? Absolute beginner to threading, not even sure the below method can be threaded. Would appreciate a little walk through. static void Main(string[] args) { IEnumerable<string> e = Enumerable.Range(1,...

Spin Lock using xchg

c,x86,locking
I'm trying to implement the simplest spinlock (using TAS) in C using inline assembly with the command xchg. Since my compiler error messages are getting more and more exotic and I'm starting to grow grey hairs I've decided to ask here. Also I'm sorry if this question was already answered...

What's the difference between isDeviceLocked and isKeyguardSecure in android's KeyguardManager?

android,api,locking,lockscreen,keyguard
Below is excerpted from http://developer.android.com/reference/android/app/KeyguardManager.html public boolean isDeviceLocked () Returns whether the device is currently locked and requires a PIN, pattern or password to unlock. Returns true if unlocking the device currently requires a PIN, pattern or password. public boolean isKeyguardSecure () Return whether the keyguard requires a password to...

How to get the amount of threads waiting to enter a lock?

c#,.net,multithreading,locking
Is it possible to get a value which indicates how many threads are waiting to acquire a lock on a certain object?

SQL Server Table Locking

sql,transactions,locking,uniqueidentifier
I need to create a unique identifier for clients, I'm implementing this using a 9 digit Luhn (9th digit being the checkdigit), so I can validate its authenticity. The numbers I want to generate are random, so I create an 8 digit number and work out the check digit to...

Excel - How to conditionally lock and unlock a particular cell using VBA.

excel,vba,excel-vba,locking,conditional-formatting
Title says it all. Any insight here? This code is most definitely not working: Sub MrFreeze(ByVal Target As Range) Dim cCell As Range Dim wksInput As Worksheet Set wksInput = Worksheets("Input") Set cCell = wksInput.Range("D14") If cCell.Value = "Yes" Then ActiveSheet.Unprotect Password = "password" Else ActiveSheet.Protect Password = "password", DrawingObjects:=True,...

How can I know the lock information in java?

java,multithreading,locking
Is there any tool or way that can get all the information about the locks in java? for example, if there is a java program, it creates two threads, and both threads require locks for some variable. Is there any tools that can output the information like which thread locks...

Thread synch and singleton questions

java,multithreading,synchronization,locking,singleton
First off I need to clear something basic, assume I have a synchronized block or a synchronized method and one thread already entered the synchronized part and 5 new threads try to access the synchronized part, will they stop running until the first thread leaves the synchronized part? and if...

What level are fread thread locks on? What level do they need to be on?

c++,c,multithreading,io,locking
Visual Studio's fread "locks out other threads." There is an alternate version _fread_nolock, which reads "without locking other threads", which should only be used "in thread-safe contexts such as single-threaded applications or where the calling scope already handles thread isolation." Even after reading other somewhat relevant discussions on the two,...

C# lock file XML for threads

c#,xml,multithreading,locking
I have a doubt about lock statment All examples that i see, lock statment is used for global variable in a same form, but in my case that no happend, then i don't know how avoid the error "file is used for another..." My case. User go to form1, and...

Is there a liquibase lock timeout?

timeout,locking,liquibase,lock-timeout
You can see in the issue here: (liquibase-lock-reasons) at situation where the client Liquibase locks when a Liquibase operation has been interrupted, leaving liquibase in a locked state. I'm wondering if there is a way to configure Liquibase to automatically detect this situation from the date and time in the...

Exclusive lock using key in .NET

c#,.net,multithreading,locking
I have used the lock statement in C# to exclusively execute a piece of code. Is there a way to do same based on a key. for e.g.: lock(object, key) { //code-here } I have a method which has some piece of code that is not thread-safe, but only if...

Multiple conditions vs Multiple locks

java,multithreading,concurrency,locking,reentrantlock
For a particular thread-safe data structure, I am needed to protect access to a central data structure (namely a byte array). I am choosing to use ReentrantLocks in this case for it's fairness policy as well as advanced capabilities with creating multiple conditions. The conditions for concurrency are complex and...

I want to sleep while holding a mutex

linux,linux-kernel,locking,linux-device-driver
I need to write to and read from a Ethernet chip's FIFO and for that I want to use DMA controller. So I modified an existing driver and made the process to sleep using wait_event_interruptible after triggering DMA transfer and made it woken up by ISR using wake_up_interruptible. My problem...

Memory visibility guarantees provided by intrinsic locking in Java?

java,multithreading,synchronization,locking,volatile
I need some clarity on what memory visibility guarantees are provided by using an intrinsic lock in Java. So for example say if I have a HashMap object that maps Strings to Person objects like so: HashMap<String,Person> m = new HashMap<String, Person>(); And lets say we have a synchronized method...

multithreading's performance is related to global queue's length if queue is not locked?

c#,multithreading,performance,locking,manualresetevent
The requirement is: Items to deal with are stored in a global queue. Several handler threads get item from global queue to handle. Producer thread adds item to global queue continuously and rapidly(much faster than all dealer threads' processing speed. Also, handler thread is compute-intensive. The best performance is CPU...

Do I need a lock in AddOrUpdate of a concurrent dictionary?

c#,.net,.net-4.0,locking,concurrentdictionary
in my class I have public static ConcurrentDictionary<string, HashSet<string>> ConnectedUserConnections = new ConcurrentDictionary<string, HashSet<string>>(); When adding or updating, should I update via: ConnectedUserConnections.AddOrUpdate(userId, new HashSet<string>(), (key, existingVal) => { existingVal.Add(connectionId); return existingVal; }); or ConnectedUserConnections.AddOrUpdate(userId, new HashSet<string>(), (key, existingVal) => { lock(ConnectedUserConnections) {...

TThreadList and “with” statement

multithreading,delphi,thread-safety,locking
just a short question regarding how to use TThreadList. Is it safe to use it with "with" statement as follows: with FEngineList.DAQEngines.LockList do begin try for Idx := 0 to Count - 1 do Items[idx].Param1 := cos(2*pi*I/Count); ... ... finally FEngineList.DAQEngines.UnlockList; end; end; or should I explicitly do it like...

Lock a file in Java with FileLock

java,multithreading,locking
I'm trying to write to a file, using a Java FileLock, to prohibit all other processes and threads from reading from it or writing to it until I'm finished with it. Given this question and the answers to it, it seems to me like this is the perfect tool for...

How can I lock inserting in multiple table?

sql,asp.net,sql-server,transactions,locking
I used this command to insert multiple records in multiple rows, how can I lock my command and rollback changes if insertion was unsuccessfull? SqlCommand cmd = new SqlCommand(); string s = @" declare @one_id int; INSERT INTO tbl_one(o1,o2,o3) VALUES(@o1,@o2,@o3); set @one_id=SCOPE_IDENTITY(); INSERT INTO tbl_two(t1,t2,f3) VALUES(@t1,@t2,@one_id); INSERT INTO tbl_two(t1,t2,f3) VALUES(@t3,@t4,@one_id);...

How can any thread signal for release of a binary semaphore

multithreading,concurrency,locking,mutex,semaphore
I am new to multithreading paradigm. While learning concurrency, every source I found says: "The difference between mutex and binary semaphore is the ownership i.e. a mutex can be signaled for release by only the thread who created it while a semaphore can be signaled any thread" Considering a scenario...

What is the Object given to Lock

c#,locking
I use lock to add items to list in parallel foreach as below. Parallel.ForEach(list, i => { //... lock (LockThread) { _asset.Add(...); } }); LockThread is a static readonly object. What I understand was that lock makes block single threaded and will not allow multitasking there. So why I should...

Java Multithreading - What Really Happens When Accessing A “Locked” Object?

java,multithreading,locking,synchronized
Given the following object defined and initialized in a wrapper class: // (thread-safe) List of Requests made by users private static List<Request> requests = Collections.synchronizedList(new ArrayList<Request>()); The following code is being called constantly in an update loop: // <-- (Thread 1 executes the following code @ Runtime=1.0000000ms) synchronized(requests) { for...

HyperSQL (HSQLDB) explicit shared (read) lock syntax

sql,database,transactions,locking,hsqldb
According to HSQLDB documentation, there are two select-for-updating directives: FOR UPDATE FOR READ ONLY If the SQL qualifier, FOR UPDATE is used, then all the updatable columns of the result set become updatable. If a cursor is declared with FOR READ ONLY, then it is not updatable. In HSQLDB, if...