user48956
user48956

Reputation: 15788

What parts of the orientdb Java API are thread safe?

Looking through the source of ORecord class, its looks like its not designed with multi-threading in mind.

Is there a guide for thread-safe use of the API?

Upvotes: 2

Views: 167

Answers (1)

Andrey Lomakin
Andrey Lomakin

Reputation: 656

If you work with database instance the common approach is to have separate instance of this object for each thread, to simplify this task you may use pool of database objects, for example com.orientechnologies.orient.core.db.OPartitionedDatabasePool. In general only OStorage instances are thread safe, the rest of objects should not be shared between threads, but should be loaded using database instance.

Upvotes: 3

Related Questions