<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dev Team Assemble &#187; Development</title>
	<atom:link href="http://www.calvinirwin.net/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.calvinirwin.net</link>
	<description>Evil beware!</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:42:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JDE BSSV Won&#8217;t Build&#8230;after package update&#8230;ummmm what?</title>
		<link>http://www.calvinirwin.net/2012/02/06/jde-bssv-wont-build-after-package-update-ummmm-what/</link>
		<comments>http://www.calvinirwin.net/2012/02/06/jde-bssv-wont-build-after-package-update-ummmm-what/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:42:57 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JDE]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[J.D.E.]]></category>
		<category><![CDATA[JD Edwards]]></category>
		<category><![CDATA[jDeveloper]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=303</guid>
		<description><![CDATA[I have been working with jDeveloper and JDE (J.D.Edwards) for a little while.  Mostly to build integration pieces for portals and custom applications.  One of the strangest things happened to me after I did a package update (upgrade to local JDE application) the other day.
After the package update, I grabbed my project code [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with jDeveloper and JDE (J.D.Edwards) for a little while.  Mostly to build integration pieces for portals and custom applications.  One of the strangest things happened to me after I did a package update (upgrade to local JDE application) the other day.</p>
<p>After the package update, I grabbed my project code from the OMW (object management workbench) and tried to go back to development.  All of a sudden it had replaced my ValueObject classes with generated classes ( really...I have no idea why) and copied some other strange code articles to my computer.  </p>
<p>This was really strange but good thing I managed to backup my code using an alternative source code control system just in case something bizarre like this happened....which of course it did.  I copied my code back over the top of the JDE code and all was well, with the exception of some oracle.e1.bssvfoundation classes not working correctly (complaining that the method could not be found, etc).  In order to build my code I needed to remove some new code (that showed up during the package build) in the <strong>c:\e812\dv812\java\source\oracle\e1\bssvfoundation</strong> folder.  I think its safe to say you can delete that entire folder because it should not exist in your source code folder.</p>
<p>To try and make a confusing story short and understandable I guess what I am trying to say if you find that you have the folder c:\e812\dv812\java\source\oracle\e1\bssvfoundation you can delete it because you probably shouldn't have it....these are system functions that you don't need the source for, and chances are if you do have the source its not the right version :s.  I am not sure why they are included in our package but they are.</p>
<p>If your still with me then I hope this helped...if you are confused then drop me a line and I will attempt to explain by adding more acronyms and file paths.</p>
<p>Calvin</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/J.D.E.' rel='tag' target='_self'>J.D.E.</a>, <a class='technorati-link' href='http://technorati.com/tag/JD+Edwards' rel='tag' target='_self'>JD Edwards</a>, <a class='technorati-link' href='http://technorati.com/tag/JDE' rel='tag' target='_self'>JDE</a>, <a class='technorati-link' href='http://technorati.com/tag/jDeveloper' rel='tag' target='_self'>jDeveloper</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2012/02/06/jde-bssv-wont-build-after-package-update-ummmm-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDE BSSV Error &#8211; E1AuthorizationException</title>
		<link>http://www.calvinirwin.net/2012/01/17/jde-bssv-error-e1authorizationexception/</link>
		<comments>http://www.calvinirwin.net/2012/01/17/jde-bssv-error-e1authorizationexception/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 18:26:19 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[BSSV]]></category>
		<category><![CDATA[Business Services]]></category>
		<category><![CDATA[JDE]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=301</guid>
		<description><![CDATA[I have been doing some integration work with JD Edwards Business Services (aka BSSV) lately and I came across this error when trying to run my Published Business Service .
Internal Server Error (Caught exception while handling request: oracle.e1.bssvfoundation.exception.E1AuthorizationException: User is not authorized to invoke this published business service
Here is the article that led me to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing some integration work with JD Edwards Business Services (aka BSSV) lately and I came across this error when trying to run my <strong>Published Business Service </strong>.</p>
<p><em>Internal Server Error (Caught exception while handling request: oracle.e1.bssvfoundation.exception.E1AuthorizationException: User is not authorized to invoke this published business service</em></p>
<p>Here is the article that led me to the answer I needed <a href="https://forums.oracle.com/forums/thread.jspa?threadID=867569">https://forums.oracle.com/forums/thread.jspa?threadID=867569</a> specifically ChrisWalsh's comment.</p>
<p>Essentially in order to run a published business service you need to have security to the object declared in JDE.  This is done in the F00950 table (or file) and should probably be setup as *ALL for your dev team.</p>
<p>HTH</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/BSSV' rel='tag' target='_self'>BSSV</a>, <a class='technorati-link' href='http://technorati.com/tag/Business+Services' rel='tag' target='_self'>Business Services</a>, <a class='technorati-link' href='http://technorati.com/tag/JDE' rel='tag' target='_self'>JDE</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2012/01/17/jde-bssv-error-e1authorizationexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Recovery Model &#8211; Modification Script</title>
		<link>http://www.calvinirwin.net/2011/10/20/sql-server-recovery-model-modification-script/</link>
		<comments>http://www.calvinirwin.net/2011/10/20/sql-server-recovery-model-modification-script/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 15:59:41 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=298</guid>
		<description><![CDATA[I often find in my sharepoint development environments that I have issues with transaction logs filling up.  This gives me the "Error" page with no indication of what the problem is...yes I can go and change the &#60;customErrors&#62; tag to set the customer errors mode to off and add the callstack to the page [...]]]></description>
			<content:encoded><![CDATA[<p>I often find in my sharepoint development environments that I have issues with transaction logs filling up.  This gives me the "Error" page with no indication of what the problem is...yes I can go and change the &lt;customErrors&gt; tag to set the customer errors mode to off and add the callstack to the page but it still doesn't address the problem.  I whipped this script up because the dev sql server we are using has well over a hundred db's on it and I didn't fell like manually typing the ALTER DATABASE [xxx] SET RECOVERY SIMPLE for each one or doing the clickity click thing either.  Now the solution below probably breaks lots of best practices and such but it works for what I wanted it to do....which is modify all existing db's recovery mode.  To modify new db's recovery mode, just set the model db's option to simple and voila..you are ready to go.
</p>
<p>
Quick note: <strong>YOU PROBABLY DO NOT WANT TO EVER...I MEAN EVER...USE THIS ON A PRODUCTION SYSTEM.</strong>
</p>
<p><code language='sql'><br />
*/</p>
<p>	Modify th recovery model for all databases on your server</p>
<p>*/</p>
<p>	DECLARE @lasterror int</p>
<p>	DECLARE @sql nvarchar(max)</p>
<p>	DECLARE @dbname nvarchar(100)</p>
<p>	DECLARE @dbid int</p>
<p>	DECLARE @recModel int</p>
<p>	-- cycle the log</p>
<p>	exec sp_cycle_errorlog </p>
<p>	CREATE Table #dbInfo</p>
<p>	(</p>
<p>		database_id int NOT NULL,</p>
<p>		dbName nvarchar(100) NOT NULL,</p>
<p>		recoveryModel int</p>
<p>	)</p>
<p>	--SELECT database_id, [name], recovery_model FROM sys.databases order by database_id</p>
<p>	SELECT TOP 1 @dbid = database_id FROM sys.databases where database_id > 4  ORDER BY database_id asc;</p>
<p>	SELECT @dbname = [name] FROM sys.databases where database_id = @dbid;</p>
<p>	SELECT @recModel = recovery_model FROM sys.databases where database_id = @dbid;</p>
<p>	-- begin backup process</p>
<p>	WHILE @dbid > 0</p>
<p>	BEGIN</p>
<p>		INSERT INTO #dbInfo (database_id, dbName, recoveryModel) VALUES (@dbid, @dbname, @recModel);</p>
<p>		IF @recModel = 1</p>
<p>		BEGIN</p>
<p>			SELECT @sql = 'ALTER DATABASE [' + @dbname + '] SET RECOVERY SIMPLE'</p>
<p>			EXEC sp_executesql @sql</p>
<p>			SELECT @lasterror = @@ERROR</p>
<p>			IF @lasterror <> 0</p>
<p>				-- log the error to the message console</p>
<p>				PRINT 'ERROR: Changing the recovery mode for database : ' + @dbname + ' with error number ' + CAST(@lasterror as nvarchar(25))</p>
<p>			ELSE</p>
<p>				PRINT 'Recovery mode changed to simple (3) for database : ' + @dbname</p>
<p>		END</p>
<p>		-- get a new record</p>
<p>		SELECT @dbid = 0;</p>
<p>		SELECT TOP 1 @dbid =  database_id FROM sys.databases where database_id > 4 and</p>
<p>			database_id NOT IN (SELECT DISTINCT x.database_id FROM #dbInfo x);</p>
<p>		SELECT @dbname = [name] FROM sys.databases where database_id = @dbid;</p>
<p>		SELECT @recModel = recovery_model FROM sys.databases where database_id = @dbid;</p>
<p>	END	</p>
<p>	DROP Table #dbInfo</p>
<p>	SELECT database_id, [name], recovery_model FROM sys.databases order by database_id</p>
<p>	GO</p>
<p></code></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Configuration' rel='tag' target='_self'>Configuration</a>, <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/moss+2007' rel='tag' target='_self'>moss 2007</a>, <a class='technorati-link' href='http://technorati.com/tag/SharePoint' rel='tag' target='_self'>SharePoint</a>, <a class='technorati-link' href='http://technorati.com/tag/SQL+Server' rel='tag' target='_self'>SQL Server</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2011/10/20/sql-server-recovery-model-modification-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Execute Commands in Windows via .NET Application</title>
		<link>http://www.calvinirwin.net/2011/05/26/execute-commands-in-windows-via-net-application/</link>
		<comments>http://www.calvinirwin.net/2011/05/26/execute-commands-in-windows-via-net-application/#comments</comments>
		<pubDate>Thu, 26 May 2011 15:44:50 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=281</guid>
		<description><![CDATA[Heres a neat little snippit that comes in handy for running commands against the operating system.
Sourced directly from here: http://stackoverflow.com/questions/691716/running-cmd-commands-via-net ...but I like having the code here as well.
&#160;
// Kills a process
&#60;span&#62; &#60;/span&#62; private static void ExecuteCommand&#40;string command&#41;
&#123;
try
&#123;
// create the ProcessStartInfo using &#34;cmd&#34; as the program to be run,
// and &#34;/c &#34; as the parameters. [...]]]></description>
			<content:encoded><![CDATA[<p>Heres a neat little snippit that comes in handy for running commands against the operating system.</p>
<p>Sourced directly from here: <a href="http://stackoverflow.com/questions/691716/running-cmd-commands-via-net" target="_blank">http://stackoverflow.com/questions/691716/running-cmd-commands-via-net</a> ...but I like having the code here as well.</p>
<pre class="csharp">&nbsp;
<span style="color: #008080; font-style: italic;">// Kills a process</span>
&lt;span&gt; &lt;/span&gt; <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> ExecuteCommand<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> command<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">try</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #008080; font-style: italic;">// create the ProcessStartInfo using &quot;cmd&quot; as the program to be run,</span>
<span style="color: #008080; font-style: italic;">// and &quot;/c &quot; as the parameters. &amp;gt; tell the command to execute the command that follows</span>
<span style="color: #000000;">System</span>.<span style="color: #0000FF;">Diagnostics</span>.<span style="color: #0000FF;">ProcessStartInfo</span> procStartUpInfo =
<a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Diagnostics</span>.<span style="color: #0000FF;">ProcessStartInfo</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;cmd&quot;</span>, <span style="color: #808080;">&quot;/c &quot;</span> + command<span style="color: #000000;">&#41;</span>;
<span style="color: #008080; font-style: italic;">// The following commands are needed to redirect the standard output.</span>
<span style="color: #008080; font-style: italic;">// This means that it will be redirected to the Process.StandardOutput StreamReader.</span>
procStartUpInfo.<span style="color: #0000FF;">RedirectStandardOutput</span> = <span style="color: #0600FF;">true</span>;
procStartUpInfo.<span style="color: #0000FF;">UseShellExecute</span> = <span style="color: #0600FF;">false</span>;
<span style="color: #008080; font-style: italic;">// Do not create a window.</span>
procStartUpInfo.<span style="color: #0000FF;">CreateNoWindow</span> = <span style="color: #0600FF;">true</span>;
<span style="color: #008080; font-style: italic;">// Now we create a process, assign its ProcessStartInfo and start it</span>
<span style="color: #000000;">System</span>.<span style="color: #0000FF;">Diagnostics</span>.<span style="color: #0000FF;">Process</span> proc = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Diagnostics</span>.<span style="color: #0000FF;">Process</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
proc.<span style="color: #0000FF;">StartInfo</span> = procStartUpInfo;
proc.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #008080; font-style: italic;">// Get the output into a string</span>
<span style="color: #FF0000;">string</span> result = proc.<span style="color: #0000FF;">StandardOutput</span>.<span style="color: #0000FF;">ReadToEnd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #008080; font-style: italic;">// Display the command output.</span>
Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>result<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception objException<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>objException<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.net' rel='tag' target='_self'>.net</a>, <a class='technorati-link' href='http://technorati.com/tag/cmd' rel='tag' target='_self'>cmd</a>, <a class='technorati-link' href='http://technorati.com/tag/command' rel='tag' target='_self'>command</a>, <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/Windows' rel='tag' target='_self'>Windows</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2011/05/26/execute-commands-in-windows-via-net-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Debugging a windows Service</title>
		<link>http://www.calvinirwin.net/2011/05/04/installing-and-debugging-a-windows-service/</link>
		<comments>http://www.calvinirwin.net/2011/05/04/installing-and-debugging-a-windows-service/#comments</comments>
		<pubDate>Wed, 04 May 2011 13:04:42 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=275</guid>
		<description><![CDATA[Here is some useful information that I always seem to forget when developing windows services.

To install/uninstall manually, which i find helpful to do from the bin folder of your project use the following commands:

INSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [the name of the executable]
UNINSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -u [the name of the executable]


To Debug a windows service add the following code [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some useful information that I always seem to forget when developing windows services.</p>
<ul>
<li>To install/uninstall manually, which i find helpful to do from the bin folder of your project use the following commands:
<ul>
<li>INSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [the name of the executable]</li>
<li>UNINSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -u [the name of the executable]</li>
</ul>
</li>
<li>To Debug a windows service add the following code to your Main method<br />
<code><br />
static void Main(string[] args)<br />
{<br />
#if DEBUG<br />
System.Diagnostics.Debugger.Break();<br />
#endif</code></p>
<p><code> </code></p>
<p style="padding-left: 30px;"><code> ServiceBase.Run(new Service());</code></p>
<p style="padding-left: 30px;"><code>}<br />
</code>
</li>
<li>To create an installation package for a service: ....I will come back to that - no time to put it together today <img src='http://www.calvinirwin.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</li>
</ul>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/services' rel='tag' target='_self'>services</a>, <a class='technorati-link' href='http://technorati.com/tag/visual+studio' rel='tag' target='_self'>visual studio</a>, <a class='technorati-link' href='http://technorati.com/tag/Windows' rel='tag' target='_self'>Windows</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2011/05/04/installing-and-debugging-a-windows-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XmlSerializer and XmlRootAttribute Performance Issue</title>
		<link>http://www.calvinirwin.net/2011/02/10/xmlserializer-and-xmlrootattribute-performance-issue/</link>
		<comments>http://www.calvinirwin.net/2011/02/10/xmlserializer-and-xmlrootattribute-performance-issue/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 03:28:52 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[serialization]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XmlSerializer]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=262</guid>
		<description><![CDATA[I have been working with xml serialization over the last week or so and ran into a strange issue today.  It only came to light when I decided to implement IXmlSerializable and write my own methods for reading and writing the xml.  I posted recently about using he XmlRootAttribute as a fix for [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with xml serialization over the last week or so and ran into a strange issue today.  It only came to light when I decided to implement IXmlSerializable and write my own methods for reading and writing the xml.  I <a href="http://www.calvinirwin.net/2011/02/10/xmlserialization-deserialize-causes-xmlns-was-not-expected/">posted</a> recently about using he XmlRootAttribute as a fix for the <a href="http://www.calvinirwin.net/2011/02/10/xmlserialization-deserialize-causes-xmlns-was-not-expected/">xmlns='' &gt; was not expected</a> error I was seeing.  This all worked fine and dandy until I really started to utilize that method over and over again in my code.  I found the performance of this to be horrible...so horrible in fact it was taking 2-3 minutes to deserialize a moderately complex 1MB xml file.  After doing some digging (on "The Google") I discovered that microsoft decided to only implement caching on the Xml serializer when you use one of the two "more common" constructors (see <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx">documentation</a>).  Of course it would seem the one I need would not be one of them.</p>
<p>I was thinking of somehow adding the XmlSerializers for each type/root pair that I was using to the application level cache or something like that but thought that might bring with it its own set of challenges.  I found a <a href="http://stackoverflow.com/questions/1534810/xmlserializer-performance-issue-when-specifying-xmlrootattribute">great article here on stack overflow</a> that shows a possible workaround for the problem using a static class to act as a cache or you.</p>
<p>Please note this code is taken directly from the article above:</p>
<p><code><br />
public static class XmlSerializerCache<br />
{<br />
     private static readonly Dictionary cache =<br />
     new Dictionary();</code></p>
<p><code>     public static XmlSerializer Create(Type type, XmlRootAttribute root)<br />
     {<br />
          var key = String.Format( CultureInfo.InvariantCulture, "{0}:{1}", type, root.ElementName);</p>
<p>          if (!cache.ContainsKey(key))<br />
          {<br />
               cache.Add(key, new XmlSerializer(type, root));<br />
          }<br />
</code><br />
<code>           return cache[key];<br />
     }<br />
}<br />
</code></p>
<p>Here is how you use it to create an XmlSerializer object:</p>
<p><code><br />
var xmlRootAttribute = new XmlRootAttribute("ExampleElement");<br />
var serializer = XmlSerializerCache.Create(target.GetType(), xmlRootAttribute);<br />
</code></p>
<p>After implementing that I was still experiencing the 2-3 minute deserialization one the first call but all subsequent calls to that code with similar xml took only 2 seconds.</p>
<p><strong>NOTE:</strong><br />
<em>Seems microsoft is in the habit of only half implementing caching in their code.  This problem is almost identical to the problems with the CrossListQueryCache object in SharePoint....where they again only implemented caching for two of the four available method signatures.  Here is an <a href="http://connect.microsoft.com/VisualStudio/feedback/details/98384/xmlserializer-memory-leak">interesting article</a> I found in the nether-regions of cyberspace where microsoft state this half implementation is by design...</em></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.net' rel='tag' target='_self'>.net</a>, <a class='technorati-link' href='http://technorati.com/tag/ASP.NET' rel='tag' target='_self'>ASP.NET</a>, <a class='technorati-link' href='http://technorati.com/tag/c+sharp' rel='tag' target='_self'>c sharp</a>, <a class='technorati-link' href='http://technorati.com/tag/c%23' rel='tag' target='_self'>c#</a>, <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/serialization' rel='tag' target='_self'>serialization</a>, <a class='technorati-link' href='http://technorati.com/tag/xml' rel='tag' target='_self'>xml</a>, <a class='technorati-link' href='http://technorati.com/tag/XmlSerializer' rel='tag' target='_self'>XmlSerializer</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2011/02/10/xmlserializer-and-xmlrootattribute-performance-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XmlSerialization Deserialize causes xmlns=&#8221; was not expected</title>
		<link>http://www.calvinirwin.net/2011/02/10/xmlserialization-deserialize-causes-xmlns-was-not-expected/</link>
		<comments>http://www.calvinirwin.net/2011/02/10/xmlserialization-deserialize-causes-xmlns-was-not-expected/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 02:48:40 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XmlSerializer]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=264</guid>
		<description><![CDATA[I had what turns out to be a fairly common error the other day when trying to deserialize an xml file in one of my applications.  Here is the code I was running:

XmlSerializer ser =  new XmlSerializer(typeof(MyObject));
XmlReader xRdr = XmlReader.Create(new StringReader(xmlData));
MyObject tvd = (MyObject)ser.Deserialize(xRdr);

As it turns out this was causing the error: xmlns=''&#62; was [...]]]></description>
			<content:encoded><![CDATA[<p>I had what turns out to be a fairly common error the other day when trying to deserialize an xml file in one of my applications.  Here is the code I was running:</p>
<p><code><br />
XmlSerializer ser =  new XmlSerializer(typeof(MyObject));<br />
XmlReader xRdr = XmlReader.Create(new StringReader(xmlData));<br />
MyObject tvd = (MyObject)ser.Deserialize(xRdr);<br />
</code></p>
<p>As it turns out this was causing the error: <strong>xmlns=''&gt; was not expected </strong> during deserialization.  Alot of the resources online (including the <a href="http://msdn.microsoft.com/en-us/library/aa302290.aspx">msdn article here</a>) were pointing me to the namespaces not being the same on the serializer and document.  I am not sure why it wasn't working for me because I was playing around with the namespaces but couldn't seem to figure out how to get that working.  Maybe because I was only serializing a fragment of a document I'm not sure.  Anyway it turns out that specifying the XmlRootAttribute in the XmlSerializer constructor fixed the problem for me.  This <a href="http://stackoverflow.com/questions/1556874/user-xmlns-was-not-expected-deserializing-twitter-xml">Stack Overflow article</a> really helped  Here is the snippet of code that I am using now:</p>
<p><code><br />
XmlRootAttribute xRoot = new XmlRootAttribute();<br />
xRoot.ElementName = elementName;<br />
xRoot.IsNullable = true;</code></p>
<p><code> </code></p>
<p><code>XmlSerializer ser =  new XmlSerializer(typeof(MyObject), xRoot);<br />
XmlReader xRdr = XmlReader.Create(new StringReader(xmlData));<br />
MyObject tvd = (MyObject)ser.Deserialize(xRdr);<br />
</code></p>
<p>Hope this helps</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.net' rel='tag' target='_self'>.net</a>, <a class='technorati-link' href='http://technorati.com/tag/ASP.NET' rel='tag' target='_self'>ASP.NET</a>, <a class='technorati-link' href='http://technorati.com/tag/c+sharp' rel='tag' target='_self'>c sharp</a>, <a class='technorati-link' href='http://technorati.com/tag/c%23' rel='tag' target='_self'>c#</a>, <a class='technorati-link' href='http://technorati.com/tag/xml' rel='tag' target='_self'>xml</a>, <a class='technorati-link' href='http://technorati.com/tag/XmlSerializer' rel='tag' target='_self'>XmlSerializer</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2011/02/10/xmlserialization-deserialize-causes-xmlns-was-not-expected/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Help My Content Database is gone!!! &#8211; SharePoint Versions are Wrong</title>
		<link>http://www.calvinirwin.net/2010/09/28/help-my-content-database-is-gone-sharepoint-versions-are-wrong/</link>
		<comments>http://www.calvinirwin.net/2010/09/28/help-my-content-database-is-gone-sharepoint-versions-are-wrong/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 13:20:06 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Content Database]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Version]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=258</guid>
		<description><![CDATA[So I was trying to restore a content db from production into my dev box the other day and got the following error:
Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version [...]]]></description>
			<content:encoded><![CDATA[<p>So I was trying to restore a content db from production into my dev box the other day and got the following error:</p>
<blockquote><p>Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version '12.0.0.6510'</p></blockquote>
<p>Ahh ok...so my dev box is out of sync no biggie, it was't a real pressing update anyway.  So I figured I would go back to my site to finish up some dev tasks and to my dismay....the site was gone.   Ummmm...hello?!?!?!</p>
<p>Turns out, the restore process (via 'stsadm -o restore -url <a href="http://omg.net">http://omg.net</a> -filename c:\arrggggh.bak') wipes out your content db.  Great so now I HAVE to update my dev box to the version of the production server (which isn't a bad idea...just rather make that choice myself!).</p>
<p>Here is a great resource for figuring out which updates you need:</p>
<p><a href="http://sharepointadminwiki.com/display/SharePointAdministrationWiki/SharePoint+Versions">http://sharepointadminwiki.com/display/SharePointAdministrationWiki/SharePoint+Versions</a></p>
<p>To determine your version of SharePoint go to Central Admin &gt; Operation &gt; Servers in Farm</p>
<p>HTH</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Content+Database' rel='tag' target='_self'>Content Database</a>, <a class='technorati-link' href='http://technorati.com/tag/SharePoint' rel='tag' target='_self'>SharePoint</a>, <a class='technorati-link' href='http://technorati.com/tag/Version' rel='tag' target='_self'>Version</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2010/09/28/help-my-content-database-is-gone-sharepoint-versions-are-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELECT TOP n ROWS &#8211; DB2</title>
		<link>http://www.calvinirwin.net/2009/12/15/select-top-n-rows-db2/</link>
		<comments>http://www.calvinirwin.net/2009/12/15/select-top-n-rows-db2/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 13:53:17 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=243</guid>
		<description><![CDATA[One thing I always seem to forget when moving from one db system to the other (not using DB2 all that often) is how to select the TOP n rows from a query.
In MS SQL Server this is expressed as SELECT TOP n * FROM [table] ...
the equivilent in DB2 is SELECT * FROM [table] FETCH [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I always seem to forget when moving from one db system to the other (not using DB2 all that often) is how to select the TOP n rows from a query.</p>
<p>In MS SQL Server this is expressed as SELECT TOP n * FROM [table] ...</p>
<p>the equivilent in DB2 is SELECT * FROM [table] FETCH FIRST n ROWS ONLY</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/DB2' rel='tag' target='_self'>DB2</a>, <a class='technorati-link' href='http://technorati.com/tag/SQL+Server' rel='tag' target='_self'>SQL Server</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2009/12/15/select-top-n-rows-db2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Collection Images and ImageFieldValue</title>
		<link>http://www.calvinirwin.net/2009/11/26/site-collection-images-and-imagefieldvalue/</link>
		<comments>http://www.calvinirwin.net/2009/11/26/site-collection-images-and-imagefieldvalue/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 03:33:46 +0000</pubDate>
		<dc:creator>Calvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://www.calvinirwin.net/?p=237</guid>
		<description><![CDATA[One of the things I was working on today was trying to get an actual image from the library was that initially I was expecting to get a PublishingImage.  All the samples on MSDN and the ones strewn about the web refer to using the ImageFieldValue and getting it from a field in the SPListItem.  [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I was working on today was trying to get an actual image from the library was that initially I was expecting to get a PublishingImage.  All the samples on MSDN and the ones strewn about the web refer to using the ImageFieldValue and getting it from a field in the SPListItem.  Like outlined on <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.fields.imagefieldvalue.aspx">MSDN </a>:</p>
<pre class="csharp">  <span style="color: #008080; font-style: italic;">// Retrieve the current value from an SPListItem with a</span>
  <span style="color: #008080; font-style: italic;">// column of the ImageField type with the name imageFieldName</span>
  ImageFieldValue currentFieldValue =
        listItemWithImageField<span style="color: #000000;">&#91;</span>imageFieldName<span style="color: #000000;">&#93;</span> <span style="color: #0600FF;">as</span> ImageFieldValue;</pre>
<p>The problem is this only works for images that are in a list, like the PublishingRollupImage of a page that links to an image in the Site Collection Images library.  The actual images in the library are stored as documents (Referenced using SPFile) so in order utilize them I need to extract the information out and create an image tag for it...like so:</p>
<pre class="csharp">&nbsp;
     ImageFieldValue imageValue = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ImageFieldValue<span style="color: #000000;">&#40;</span>
          <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;&lt;img src=<span style="color: #008080; font-weight: bold;">\&quot;</span>{0}<span style="color: #008080; font-weight: bold;">\&quot;</span> alt=<span style="color: #008080; font-weight: bold;">\&quot;</span>{1}<span style="color: #008080; font-weight: bold;">\&quot;</span> /&gt;&quot;</span>,
          file.<span style="color: #0000FF;">Url</span>, file.<span style="color: #0000FF;">Title</span> == <span style="color: #0600FF;">null</span> ? <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span> : file.<span style="color: #0000FF;">Title</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;</pre>
<p>Now that I had the ImageFieldValue it was easy to work with.  I could manipulate many aspects of the image using this object and then save it for rendering using ToString().  Funny thing is for my purposes (ImageGallery xml generation) I didn't even end up needing this code after all...frustrating but a good learning experience.  </p>
<p>Props to <a href="http://vlifeblog.com">Phanat Chan</a> as he did the initial development on this.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Development' rel='tag' target='_self'>Development</a>, <a class='technorati-link' href='http://technorati.com/tag/moss+2007' rel='tag' target='_self'>moss 2007</a>, <a class='technorati-link' href='http://technorati.com/tag/SharePoint' rel='tag' target='_self'>SharePoint</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.calvinirwin.net/2009/11/26/site-collection-images-and-imagefieldvalue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

