The spareC++, an object-oriented database programming language, is an extension of C++ designed for writing applications on object-oriented databases. Since programmers can define and manipulate objects uniformly irrespective of their persistent states and of whether or not they are resident in virtual memory, spareC++ alleviates the impedance mismatch. In addition this language supports automatic object locking. The lock for each object access in applications can be automatically determined in compile-time and then the lock can be automatically requested just before the object is accessed in run-time. Therefore there is no need to spend time on overcoming the impedance mismatch and locking objects. This improves the productivity of application development.