When I try to write to a table with a field of type ntext, some string size of 100KB, all that has been written is string of 4kB. I know about a restriction but I dont know to remove it. Please help.
Hibernate version:1.0.1.0
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Accordia.DataLayer.Configuration.AppRssCatalog, DataLayer" table="app_rss_catalog">
<id name="AppRssCatalogId" column="app_rss_catalog_id" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property column="rss_catalog_time_to_live" type="Int32" name="RssCatalogTimeToLive" />
<!-- this feeld is a problem--><property column="rss_catalog" type="String" name="RssCatalog" not-null="true" length="1073741823" />
<property column="currnetly_avaible" type="Boolean" name="CurrnetlyAvaible" not-null="true" />
<property column="last_time_refershed" type="DateTime" name="LastTimeRefershed" not-null="true" />
<property column="start_date" type="DateTime" name="StartDate" not-null="true" />
<property column="end_date" type="DateTime" name="EndDate" />
<property column="xml_url" type="String" name="XmlUrl" not-null="true" length="1000" />
<many-to-one name="AppRssCatalogCategoryId" column="app_rss_catalog_category_id" class="Accordia.DataLayer.Configuration.AppRssCatalogCategory,DataLayer" />
</class>
</hibernate-mapping>
[/b]
Code between sessionFactory.openSession() and session.close(): ISession sess = SessionManager.getSession(); if(!sess.IsConnected) sess.Reconnect(); System.Net.WebClient webClient = new WebClient();
string str = ASCIIEncoding.Default.GetString(webClient.DownloadData(@"http://news.com.com/2547-1_3-0-5.xml"));
AppRssCatalog rss = new AppRssCatalog(); rss.RssCatalog = str; //this string XmlDocument doc = new XmlDocument(); doc.LoadXml(str); string timeToLive = String.Empty; foreach(XmlNode node in doc.SelectNodes("/rss/channel/ttl")) { timeToLive = node.InnerText; } if (timeToLive != String.Empty) { rss.RssCatalogTimeToLive = int.Parse(timeToLive); } else { rss.RssCatalogTimeToLive = 0; } rss.CurrnetlyAvaible = true; rss.XmlUrl = @"http://news.com.com/2547-1_3-0-5.xml"; AppRssCatalogCategory cat = (AppRssCatalogCategory)sess.Get(typeof(AppRssCatalogCategory), 1); rss.AppRssCatalogCategoryId = cat;
cat.AppRssCatalogList.Add(rss); sess.Update(cat); sess.Flush(); sess.Disconnect();
Full stack trace of any exception that occurs:
Name and version of the database you are using: SQL Server 2005
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|