# desktop-mode/1.1.9/includes/storage-primary.php

OpenStation: Desktop Windows, Dock &amp; Virtual Desktops for WP Admin, version 1.1.9. 28 lines.

- Page: https://pluginprobe.com/plugins/desktop-mode/1.1.9/code/includes/storage-primary.php
- Raw: https://pluginprobe.com/plugins/desktop-mode/1.1.9/raw/includes/storage-primary.php
- Modified: 2026-09-12T11:06:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/desktop-mode/1.1.9/code/includes/storage-primary.php#L10-L20`.

```php
<?php
/**
 * Primary routing for storage operations that depend on current database state.
 *
 * @package OpenStation
 */
defined( 'ABSPATH' ) || exit;

/**
 * Keep advisory locks and their protected reads on writable connections.
 *
 * HyperDB classifies SELECT GET_LOCK and SELECT FOR UPDATE as reads. Use its
 * supported routing API before acquiring the lock; LudicrousDB has a renamed
 * equivalent. Keep this routing for the request so release and readbacks cannot
 * move to a lagging replica. Standard wpdb already uses one connection.
 *
 * @internal
 * @return void
 */
function openstation_storage_use_primary() {
	global $wpdb;
	if ( is_callable( array( $wpdb, 'send_reads_to_primaries' ) ) ) {
		$wpdb->send_reads_to_primaries();
	} elseif ( is_callable( array( $wpdb, 'send_reads_to_masters' ) ) ) {
		$wpdb->send_reads_to_masters();
	}
}

```
