Index: /trunk/Nebulous-Server/Changes
===================================================================
--- /trunk/Nebulous-Server/Changes	(revision 19958)
+++ /trunk/Nebulous-Server/Changes	(revision 19959)
@@ -20,4 +20,6 @@
     - remove call to getmountedvol() stored proc from Nebulous::Server->mount()
       as it's uneeded
+    - change getmountedvol() to use a view of the volume table to avoid table
+      level locks being set by a cursor
 
 0.15 Thu Sep 11 13:00:59 HST 2008
Index: /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 19958)
+++ /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 19959)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.65 2008-10-01 02:06:17 jhoblitt Exp $
+# $Id: SQL.pm,v 1.66 2008-10-07 21:53:21 jhoblitt Exp $
 
 package Nebulous::Server::SQL;
@@ -498,13 +498,14 @@
     DECLARE xattrvar BOOLEAN;
     DECLARE trans_level VARCHAR(255);
-    DECLARE cur1 CURSOR FOR SELECT vol_id, name, host, path, allocate, available, xattr FROM volume;
+    DECLARE cur1 CURSOR FOR SELECT vol_id, name, host, path, allocate, available, xattr FROM v;
     DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = TRUE;
 
+    CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW v AS SELECT * FROM volume;
     -- store the current transaction level
-    SELECT @@session.tx_isolation INTO trans_level; 
+--    SELECT @@session.tx_isolation INTO trans_level; 
 
     -- set trans level to repeatable-read so the volume table does not change
     -- out from under our cursor
-    SET @@session.tx_isolation = 'REPEATABLE-READ';
+--    SET @@session.tx_isolation = 'REPEATABLE-READ';
 
     -- iterate over the volume table finding the coresponding entry in the
@@ -531,6 +532,7 @@
 
     -- restore the original transaction level
-    SET @@session.tx_isolation = trans_level;
-
+--    SET @@session.tx_isolation = trans_level;
+
+    DROP VIEW v;
     COMMIT;
 END 
