Index: beagled/Lucene.Net/Index/SegmentReader.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/Lucene.Net/Index/SegmentReader.cs,v
retrieving revision 1.4
diff -u -p -u -r1.4 SegmentReader.cs
--- beagled/Lucene.Net/Index/SegmentReader.cs	15 Mar 2006 19:12:18 -0000	1.4
+++ beagled/Lucene.Net/Index/SegmentReader.cs	30 Mar 2006 21:18:26 -0000
@@ -37,6 +37,8 @@ namespace Lucene.Net.Index
 		
 		internal TermInfosReader tis;
 		internal TermVectorsReader termVectorsReaderOrig = null;
+
+		[ThreadStatic]
 		private TermVectorsReader tvReader;
 		
 		internal BitVector deletedDocs = null;
Index: beagled/Lucene.Net/Index/TermBuffer.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/Lucene.Net/Index/TermBuffer.cs,v
retrieving revision 1.2
diff -u -p -u -r1.2 TermBuffer.cs
--- beagled/Lucene.Net/Index/TermBuffer.cs	6 Oct 2005 19:29:55 -0000	1.2
+++ beagled/Lucene.Net/Index/TermBuffer.cs	30 Mar 2006 21:18:26 -0000
@@ -53,10 +53,24 @@ namespace Lucene.Net.Index
 		
         private void  SetTextLength(int newLength)
         {
+		if (newLength > 1000 || textLength > 1000 || text.Length > 1000) {
+			Beagle.Util.Log.Debug ("textLength: {0}\ntext.Length: {1}\nnewLength: {2}",
+					       textLength, text.Length, newLength);
+			throw new Exception ();
+		}
+
+
             if (text.Length < newLength)
             {
                 char[] newText = new char[newLength];
-                Array.Copy(text, 0, newText, 0, textLength);
+		try {
+			Array.Copy(text, 0, newText, 0, textLength);
+		} catch (Exception e) {
+			Beagle.Util.Log.Debug ("Caught exception: {0}", e);
+			Beagle.Util.Log.Debug ("textLength: {0}\ntext.Length: {1}\nnewLength: {2}",
+					       textLength, text.Length, newLength);
+			return;
+		}			
                 text = newText;
             }
             textLength = newLength;
Index: beagled/Lucene.Net/Index/TermInfosReader.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/Lucene.Net/Index/TermInfosReader.cs,v
retrieving revision 1.5
diff -u -p -u -r1.5 TermInfosReader.cs
--- beagled/Lucene.Net/Index/TermInfosReader.cs	15 Mar 2006 19:12:19 -0000	1.5
+++ beagled/Lucene.Net/Index/TermInfosReader.cs	30 Mar 2006 21:18:26 -0000
@@ -29,7 +29,9 @@ namespace Lucene.Net.Index
 		private System.String segment;
 		private FieldInfos fieldInfos;
 
+		[ThreadStatic]
 		private SegmentTermEnum termEnum;
+
 		private SegmentTermEnum origEnum;
 		private long size;
 		
