You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,25 +24,141 @@ Represents a single database access session.
20
24
```cpp
21
25
classCSession
22
26
```
27
+
28
+
## Requirements
29
+
**Header:** atldbcli.h
23
30
24
31
## Members
25
32
26
33
### Methods
27
34
28
35
|||
29
36
|-|-|
30
-
|[Abort](../../data/oledb/csession-abort.md)|Cancels (terminates) the transaction.|
31
-
|[Close](../../data/oledb/csession-close.md)|Closes the session.|
32
-
|[Commit](../../data/oledb/csession-commit.md)|Commits the transaction.|
33
-
|[GetTransactionInfo](../../data/oledb/csession-gettransactioninfo.md)|Returns information regarding a transaction.|
34
-
|[Open](../../data/oledb/csession-open.md)|Opens a new session for the data source object.|
35
-
|[StartTransaction](../../data/oledb/csession-starttransaction.md)|Begins a new transaction for this session.|
37
+
|[Abort](#abort)|Cancels (terminates) the transaction.|
38
+
|[Close](#close)|Closes the session.|
39
+
|[Commit](#commit)|Commits the transaction.|
40
+
|[GetTransactionInfo](#gettransactioninfo)|Returns information regarding a transaction.|
41
+
|[Open](#open)|Opens a new session for the data source object.|
42
+
|[StartTransaction](#starttransaction)|Begins a new transaction for this session.|
36
43
37
44
## Remarks
38
-
One or more sessions can be associated with each provider connection (data source), which is represented by a [CDataSource](../../data/oledb/cdatasource-class.md) object. To create a new `CSession` for a `CDataSource`, call [CSession::Open](../../data/oledb/csession-open.md). To begin a database transaction, `CSession` provides the `StartTransaction` method. Once a transaction is started, you can commit to it using the **Commit** method, or cancel it using the **Abort** method.
45
+
One or more sessions can be associated with each provider connection (data source), which is represented by a [CDataSource](../../data/oledb/cdatasource-class.md) object. To create a new `CSession` for a `CDataSource`, call [CSession::Open](../../data/oledb/csession-open.md). To begin a database transaction, `CSession` provides the `StartTransaction` method. Once a transaction is started, you can commit to it using the `Commit` method, or cancel it using the `Abort` method.
39
46
40
-
## Requirements
41
-
**Header:** atldbcli.h
47
+
## <a name="abort"></a> CSession::Abort
48
+
Terminates the transaction.
49
+
50
+
### Syntax
51
+
52
+
```cpp
53
+
HRESULT Abort(BOID* pboidReason = NULL,
54
+
BOOL bRetaining = FALSE,
55
+
BOOL bAsync = FALSE) const throw();
56
+
```
57
+
58
+
#### Parameters
59
+
See [ITransaction::Abort](https://msdn.microsoft.com/library/ms709833.aspx) in the *OLE DB Programmer's Reference*.
60
+
61
+
### Return Value
62
+
A standard HRESULT.
63
+
64
+
## <aname="close"></a> CSession::Close
65
+
Closes the session, which was opened by [CSession::Open](../../data/oledb/csession-open.md).
66
+
67
+
### Syntax
68
+
69
+
```cpp
70
+
voidClose() throw();
71
+
72
+
```
73
+
74
+
### Remarks
75
+
Releases the `m_spOpenRowset` pointer.
76
+
77
+
## <aname="commit"></a> CSession::Commit
78
+
Commits the transaction.
79
+
80
+
### Syntax
81
+
82
+
```cpp
83
+
HRESULT Commit(BOOL bRetaining = FALSE,
84
+
DWORD grfTC = XACTTC_SYNC,
85
+
DWORD grfRM = 0) const throw();
86
+
```
87
+
88
+
#### Parameters
89
+
See [ITransaction::Commit](https://msdn.microsoft.com/library/ms713008.aspx) in the *OLE DB Programmer's Reference*.
90
+
91
+
### Return Value
92
+
A standard HRESULT.
93
+
94
+
### Remarks
95
+
For more information, see [ITransaction::Commit](https://msdn.microsoft.com/library/ms713008.aspx).
See [ITransaction::GetTransactionInfo](https://msdn.microsoft.com/library/ms714975.aspx) in the *OLE DB Programmer's Reference*.
108
+
109
+
### Return Value
110
+
A standard HRESULT.
111
+
112
+
### Remarks
113
+
For more information, see [ITransaction::GetTransactionInfo](https://msdn.microsoft.com/library/ms714975.aspx) in the *OLE DB Programmer's Reference*.
114
+
115
+
## <aname="open"></a> CSession::Open
116
+
Opens a new session for the data source object.
117
+
118
+
### Syntax
119
+
120
+
```cpp
121
+
HRESULT Open(const CDataSource& ds,
122
+
DBPROPSET *pPropSet = NULL,
123
+
ULONG ulPropSets = 0) throw();
124
+
```
125
+
126
+
#### Parameters
127
+
*ds*
128
+
[in] The data source for which the session is to be opened.
129
+
130
+
*pPropSet*
131
+
[in] A pointer to an array of [DBPROPSET](https://msdn.microsoft.com/library/ms714367.aspx) structures containing properties and values to be set. See [Property Sets and Property Groups](https://msdn.microsoft.com/library/ms713696.aspx) in the *OLE DB Programmer's Reference* in the Windows SDK.
132
+
133
+
*ulPropSets*
134
+
[in] The number of [DBPROPSET](https://msdn.microsoft.com/library/ms714367.aspx) structures passed in the *pPropSet* argument.
135
+
136
+
### Return Value
137
+
A standard HRESULT.
138
+
139
+
### Remarks
140
+
You must open the data source object using [CDataSource::Open](../../data/oledb/cdatasource-open.md) before passing it to `CSession::Open`.
See [ITransactionLocal::StartTransaction](https://msdn.microsoft.com/library/ms709786.aspx) in the *OLE DB Programmer's Reference*.
156
+
157
+
### Return Value
158
+
A standard HRESULT.
159
+
160
+
### Remarks
161
+
For more information, see [ITransactionLocal::StartTransaction](https://msdn.microsoft.com/library/ms709786.aspx) in the *OLE DB Programmer's Reference*.
0 commit comments