ATLAS Offline Software
Loading...
Searching...
No Matches
UserSession.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INCLUDE_PERSISTENCYSVC_USERSESSION_H
6#define INCLUDE_PERSISTENCYSVC_USERSESSION_H
7
10#include "StorageSvc/DbPrint.h"
11
12#include <map>
13
14namespace pool {
15
17
18 // forward declarations
19 class DatabaseRegistry;
21
27
28 class UserSession : public ISession, public APRMessaging
29 {
30 public:
33
35 virtual ~UserSession();
36
37 UserSession (const UserSession&) = delete;
39
40
52 virtual void* readObject( const Token& token, void* object = 0 ) override;
53
54
64 virtual Token* registerForWrite( const Placement& place, const void* object, const RootType& type ) override;
65
66
67 // Signatures needed for the PersistencySvc
69 //TechnologyDispatcher& technologyDispatcher();
70
72 virtual void setDefaultConnectionPolicy( const DatabaseConnectionPolicy& policy ) override final;
73
76
80 virtual bool disconnectAll() override final;
81
83 virtual ITransaction& transaction() override final { return *this; }
84 virtual const ITransaction& transaction() const override final { return *this; }
85
87 virtual bool start( ITransaction::Type type = READ ) override final;
88
90 virtual bool commit() override final;
91
93 virtual bool commitAndHold() override final;
94
96 virtual bool isActive() const override final { return m_transactionType != ITransaction::INACTIVE; }
97
99 virtual ITransaction::Type type() const override final { return m_transactionType; }
100
103
105 virtual std::unique_ptr<IDatabase>
106 databaseHandle( const std::string& dbName, DatabaseSpecification::NameType dbNameType ) override final;
107
109 virtual IFileCatalog& fileCatalog() override final;
110
113
116 technologySpecificAttributes( long technology ) const override final;
117
119 technologySpecificAttributes( long technology ) override final;
120
123
124 private:
130
131 };
132}
133
134#endif
TTypeAdapter RootType
Definition RootType.h:211
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition Placement.h:19
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
STL class.
APRMessaging(const std::string &name)
DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a datab...
ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a...
Definition ISession.h:39
ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.
ITransaction is the interface class for user (macroscopic transactions) Every operation with the pool...
Type
Transaction type enumeration.
virtual Type type() const =0
Returns the transaction type.
MicroSessionManager is a class taking care of starting sessions for a given major technology and mana...
IFileCatalog * m_catalog
virtual IFileCatalog & fileCatalog() override final
Returns the file catalog in use.
UserSession(const UserSession &)=delete
DatabaseConnectionPolicy * m_policy
DatabaseRegistry * m_registry
virtual ITransaction::Type type() const override final
Returns the transaction type.
Definition UserSession.h:99
virtual const ITransaction & transaction() const override final
Definition UserSession.h:84
MicroSessionManager & microSessionManager(long technology)
Returns the technology given a technology type.
virtual bool disconnectAll() override final
Explicitly disconnects all the databases.
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...
virtual bool commit() override final
Commits the transaction.
virtual ~UserSession()
Destructor.
ITransaction::Type m_transactionType
virtual const ITechnologySpecificAttributes & technologySpecificAttributes(long technology) const override final
Returns the object holding the technology specific attributes for a given technology domain.
std::map< long, std::unique_ptr< MicroSessionManager > > m_technologies
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 start(ITransaction::Type type=READ) override final
Starts a new transaction. Returns the success of the operation.
void setFileCatalog(IFileCatalog &catalog)
Set the file catalog to be used.
virtual bool commitAndHold() override final
Commits and holds the transaction.
virtual bool isActive() const override final
Checks if the transaction is active.
Definition UserSession.h:96
virtual ITransaction & transaction() override final
Returns the transaction interface.
Definition UserSession.h:83
virtual void setDefaultConnectionPolicy(const DatabaseConnectionPolicy &policy) override final
Sets the default policy when databases are opened/connected.
UserSession(IFileCatalog &fileCatalog)
Constructor.
ITransaction::Type transactionType() const
Returns the transaction type.
UserSession & operator=(const UserSession &)=delete
virtual const DatabaseConnectionPolicy & defaultConnectionPolicy() const override final
Retrieves the default connection policy.
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 & registry()
STL class.
Framework include files.
Definition libname.h:15
STL namespace.
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:23
#define private