Click here to Skip to main content
15,891,033 members
Articles / Programming Languages / XML

Building a Middle Tier Component using NHibernate and Spring.NET

Rate me:
Please Sign up or sign in to vote.
4.50/5 (21 votes)
10 May 2006CPOL8 min read 158.8K   2.4K   109  
Building a highly pluggable middle-tier component with NHibernate and Spring.Net.
#region Licence

/*
 * Copyright � 2002-2005 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#endregion

#region Imports

using System;

using log4net;

#endregion

namespace Spring.Transaction
{
	/// <summary>
	/// Interface that specifies means to programmatically manage
	/// transaction savepoints in a generic fashion.
	///
	/// <p>Note that savepoints can only work within an active transaction.
	/// Just use this programmatic savepoint handling for advanced needs;
	/// else, a subtransaction with PROPAGATION_NESTED is preferable.</p>
	///
	///
	/// <author> Juergen Hoeller </author>
	/// <author> Moim Hossain (.NET)</author>
	/// </summary>
	public interface ISavepointManager
	{
		/// <summary>
		/// Create a new savepoint. You can roll back to a specific savepoint
		/// via <code>RollbackToSavepoint</code>, and explicitly release a
		/// savepoint that you don't need anymore via <code>ReleaseSavepoint</code>.
		/// <p>Note that most transaction managers will automatically release
		/// savepoints at transaction completion.</p>
		/// <returns> a savepoint object, to be passed into RollbackToSavepoint </returns>
		/// or ReleaseSavepoint
		/// </summary>
		Object CreateSavepoint() ;
		/// <summary>
		/// Roll back to the given savepoint. The savepoint will be
		/// automatically released afterwards.		 
		/// <param name="savePoint">the savepoint to roll back to</param>		
		/// </summary>
		void RollbackToSavepoint(Object savePoint);	
		/// <summary>
		/// Explicitly release the given savepoint.
		/// <p>Note that most transaction managers will automatically release
		/// savepoints at transaction completion.</p>
		/// <p>Implementations should fail as silently as possible if
		/// proper resource cleanup will still happen at transaction completion.</p>
		/// <param name="savePoint">the savepoint to release</param>
		/// </summary>
		void ReleaseSavepoint(Object savePoint);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Netherlands Netherlands
Engineer Powered by the Cloud

Comments and Discussions