[LON-CAPA-cvs] cvs: loncom(version_1_0_X) /interface loncoursedata.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 03 Oct 2003 15:33:25 -0000


albertel		Fri Oct  3 11:33:25 2003 EDT

  Modified files:              (Branch: version_1_0_X)
    /loncom/interface	loncoursedata.pm 
  Log:
  - backport 1.99
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.81.2.1 loncom/interface/loncoursedata.pm:1.81.2.2
--- loncom/interface/loncoursedata.pm:1.81.2.1	Wed Oct  1 17:41:47 2003
+++ loncom/interface/loncoursedata.pm	Fri Oct  3 11:33:25 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.81.2.1 2003/10/01 21:41:47 albertel Exp $
+# $Id: loncoursedata.pm,v 1.81.2.2 2003/10/03 15:33:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -866,6 +866,36 @@
     return $students_by_id{$student_id} if(exists($students_by_id{$student_id}));
     return undef; # error
 }
+
+################################################
+################################################
+
+=pod
+
+=item &clear_internal_caches()
+
+Causes the internal caches used in get_student_id, get_student,
+get_symb_id, get_symb, get_part_id, and get_part to be undef'd.
+
+Needs to be called before the first operation with the MySQL database
+for a given Apache request.
+
+=cut
+
+################################################
+################################################
+sub clear_internal_caches {
+    $have_read_part_table = 0;
+    undef(%ids_by_part);
+    undef(%parts_by_id);
+    $have_read_symb_table = 0;
+    undef(%ids_by_symb);
+    undef(%symbs_by_id);
+    $have_read_student_table = 0;
+    undef(%ids_by_student);
+    undef(%students_by_id);
+}
+
 
 ################################################
 ################################################