\brief Starts a session for proj_get_insert_statements() * * Starts a new session for one or several calls to * proj_get_insert_statements(). * * An insertion session guarantees that the inserted objects will not create * conflicting intermediate objects. * * The session must be stopped with proj_insert_object_session_destroy(). * * Only one session may be active at a time for a given co
| 9424 | * @since 8.1 |
| 9425 | */ |
| 9426 | PJ_INSERT_SESSION *proj_insert_object_session_create(PJ_CONTEXT *ctx) { |
| 9427 | SANITIZE_CTX(ctx); |
| 9428 | try { |
| 9429 | auto dbContext = getDBcontext(ctx); |
| 9430 | dbContext->startInsertStatementsSession(); |
| 9431 | PJ_INSERT_SESSION *session = new PJ_INSERT_SESSION; |
| 9432 | session->ctx = ctx; |
| 9433 | return session; |
| 9434 | } catch (const std::exception &e) { |
| 9435 | proj_log_error(ctx, __FUNCTION__, e.what()); |
| 9436 | return nullptr; |
| 9437 | } |
| 9438 | } |
| 9439 | |
| 9440 | // --------------------------------------------------------------------------- |
| 9441 |