15std::unique_ptr< pool::ISession >
46 if ( db.openMode() == Io::INVALID ) {
50 result = db.databaseHandler().readObject( token,
object );
64 if ( db.openMode() == Io::INVALID ) {
68 return db.databaseHandler().writeObject( place.
containerName(),
87 if( !iManager.second->disconnectAll() ) ret =
false;
108 bool bCommit = db->commitTransaction();
111 <<
"FID = " << db->fid() <<
endmsg <<
"PFN = " << db->pfn() );
128 bool bCommit = db->commitAndHoldTransaction();
131 <<
"FID = " << db->fid() <<
endmsg <<
"PFN = " << db->pfn() );
142std::unique_ptr<pool::IDatabase>
147 return std::make_unique<UserDatabase>( *
this, dbName, dbNameType );
172 return *(iManager->second);
#define ATH_MSG_ERROR(x,...)
This file contains the class definition for the Placement class (migrated from POOL).
This file contains the class definition for the Token class (migrated from POOL).
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
This class holds all the necessary information to guide the writing of an object in a physical place.
const std::string & containerName() const
Access container name.
const std::string & fileName() const
Access file name.
int technology() const
Access technology type.
This class provides a token that identifies in a unique way objects on the persistent storage.
int technology() const
Access technology type.
const Guid & dbID() const
Access database identifier.
APRMessaging(const std::string &name)
int majorType() const
Access to major type.
ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.
MicroSessionManager is a class taking care of starting sessions for a given major technology and mana...
UserDatabase is an implementation of the IDatabase interface.
UserSession is an implementation of the ISession interface.
DatabaseRegistry & registry()
virtual Token * registerForWrite(const Placement &place, const void *object, const RootType &type) override
registerForWrite registers an object for writing to the persistent medium higher level interactions w...
MicroSessionManager & microSessionManager(long technology)
Returns the technology given a technology type.
virtual void * readObject(const Token &token, void *object=0) override
Retrieves an object from persistent store and return with type information The handle to the reflecti...
DatabaseRegistry * m_registry
virtual bool start(Io::IoFlag type=Io::READ) override final
Starts a new transaction. Returns the success of the operation.
virtual Io::IoFlag type() const override final
Returns the transaction type.
virtual bool commitAndHold() override final
Commits and holds the transaction.
std::map< long, std::unique_ptr< MicroSessionManager > > m_technologies
virtual IFileCatalog & fileCatalog() override final
Returns the file catalog in use.
virtual bool commit() override final
Commits the transaction.
Io::IoFlag m_transactionType
void setFileCatalog(IFileCatalog &catalog)
Set the file catalog to be used.
virtual bool isActive() const override final
Checks if the transaction is active.
UserSession(IFileCatalog &fileCatalog, int ageLimit)
Constructor.
virtual ITechnologySpecificAttributes & technologySpecificAttributes(long technology) override final
Returns the object holding the technology specific attributes for a given technology domain.
virtual std::unique_ptr< IDatabase > databaseHandle(const std::string &dbName, DatabaseSpecification::NameType dbNameType) override final
Creates and returns a new database handle object.
virtual bool disconnectAll() override final
Explicitly disconnects all the databases.
virtual ~UserSession()
Destructor.
static const long long int INVALID
std::unique_ptr< ISession > createSession(IFileCatalog &catalog, int ageLimit=-1)
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...