ScalarDB SQL API Guide
This guide describes how to use ScalarDB SQL API.
SqlSessionFactory​
In ScalarDB SQL API, you execute all operations through a SqlSession instance, which is instantiated with SqlSessionFactory.
This section explains how to use them.
Before explaining SqlSessionFactory, we start with the explanation for Connection mode and Transaction mode.
Connection mode​
ScalarDB SQL offers two connection modes: Direct and Server modes. With Direct mode, ScalarDB SQL client-side library directly uses ScalarDB API. On the other hand, with Server mode, ScalarDB SQL client-side library uses ScalarDB API indirectly through ScalarDB SQL Server.
You can specify a connection mode in your configuration file or when you build SqlSessionFactory.
And if you don't specify it, Direct mode is used by default.
Transaction mode​
Also, ScalarDB SQL offers two transaction modes: Transaction mode and Two-phase Commit Transaction mode.
Transaction mode exposes only commit interface to users and runs two-phase commit behind the scene, while Two-phase Commit Transaction mode exposes two-phase commit style interfaces (prepare and commit) to users.
You can specify the default transaction mode in your configuration file or when you build SqlSessionFactory.
And you also can change it with the setTransactionMode() method of SqlSession.