我通过阅读PDF文件在mysql DB中插入记录。假设要在DB中插入14000条记录。但是在大约700-800条记录之后,我得到一个例外,因为“在创建会话工厂时使用了无效或不完整的配置”。我正在使用流利的Nhibernate&我的代码在asp.net中。任何人都可以帮我解决这个问题吗?
答案 0 :(得分:0)
for (int i = 1; i <= iPages; i++) // ipages value is 2213
{
string strPageText = PdfTextExtractor.GetTextFromPage(pdfRdr, i);
strPageText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(strPageText)));
string[] strRows = strPageText.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
string strName = string.Empty;
string[] strNames;
string strStatus = string.Empty;
string EmailAddress = string.Empty;
int rowCount = 1;
int iPtRowCnt = 0;
bool caseFiveFlag = false;
Patient objPt = new Patient();
objPt.PatientContact = new PatientContact();
foreach (string strRowText in strRows)
{
// here I am inserting records by parsing .pdf file
// my pdf file is 5mb
}