Skip to content

Commit 987ff78

Browse files
committed
Updated comment on open_forever() method
1 parent 722e7e4 commit 987ff78

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dev/storage_base.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ namespace sqlite_orm {
291291
/**
292292
* Call it once during storage lifetime to make it keeping its connection opened till dtor call.
293293
* By default if storage is not in-memory it calls `sqlite3_open` only when the connection is really
294-
* needed and closes when it is not needed. This function breaks this rule. In memory storage always
295-
* keeps connection opened so calling this for in-memory storage changes nothing.
296-
* Note about multithreading: in multithreading context avoiding using this function for not in-memory
297-
* storage may lead to data races. If you have data races in such a configuration try to call `open_forever()`
298-
* before accessing your storage - it may fix data races.
294+
* needed and closes when it is not needed. This function establishes a permanent connection.
295+
* In-memory storage always establishes a permanent connection, so calling this method is a no-op.
296+
*
297+
* Attention: You must ensure that you cal lthis method in a single-threaded context.
298+
* An alternative way to establish a permanent connection is to specify control options to `make_storage()`.
299299
*/
300300
void open_forever() {
301301
if (!this->isOpenedForever) {

include/sqlite_orm/sqlite_orm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19046,11 +19046,11 @@ namespace sqlite_orm {
1904619046
/**
1904719047
* Call it once during storage lifetime to make it keeping its connection opened till dtor call.
1904819048
* By default if storage is not in-memory it calls `sqlite3_open` only when the connection is really
19049-
* needed and closes when it is not needed. This function breaks this rule. In memory storage always
19050-
* keeps connection opened so calling this for in-memory storage changes nothing.
19051-
* Note about multithreading: in multithreading context avoiding using this function for not in-memory
19052-
* storage may lead to data races. If you have data races in such a configuration try to call `open_forever()`
19053-
* before accessing your storage - it may fix data races.
19049+
* needed and closes when it is not needed. This function establishes a permanent connection.
19050+
* In-memory storage always establishes a permanent connection, so calling this method is a no-op.
19051+
*
19052+
* Attention: You must ensure that you cal lthis method in a single-threaded context.
19053+
* An alternative way to establish a permanent connection is to specify control options to `make_storage()`.
1905419054
*/
1905519055
void open_forever() {
1905619056
if (!this->isOpenedForever) {

0 commit comments

Comments
 (0)