I have a service, business and data access layer. In which layer should I implement transactions using asp.NET transactionscope? Also, is nesting Transactions a good thing because I had problems with that?
...
I have read the documentation and explanation on why it is highly recommended to use transactions on read operations in NH. However, I still haven't totally "bought" into it yet. Can someone take a stab at explaining it without just telling me to RTFM, which I have already done? ;)
...
I am using Spring in my Web Application , with the underlying database as Sybase.
I have 3 complex stored procedures to be executed.
The procs , have create table and drop table commands to hold temporary result sets.
The tables are created in the user db space , rather that in the tempdb space. Hence, I am faced with the need to ensu...
how to translate this to C#
import java.io.*;
import java.net.*;
class SimpleServer
{
private static SimpleServer server;
ServerSocket socket;
Socket incoming;
BufferedReader readerIn;
PrintStream printOut;
public static void main(String[] args)
{
int port = 8080;
try
{
port = Integer.parseInt(arg...
Hey,
Is there any way to "replay" transaction?
I mean, sometimes I get RollbackException and rollback the transaction. Can I then "clone" the transaction and try again, or once rollback is called, transaction is lost?
I really need the changes, and really don't want to trace every change for rerunning later...
thanks,
udi
...
Hi,
I would like to know what are the best practices, if you have a quite long lasting process that ends up with a transaction timeout and which should definitely be possible to rollback if any exception is thrown within?
Imagine that all along the application set timeout duration is quite enough but for such a specific one it is not ...
I would like to get NHibernate to roll back the identifier of any entities saved during a transaction if the transaction is aborted. I am using NHibernate 2.1.0, and it doesn't do this by default. I came up with the following solution, which works up to a point:
public class RevertIdentifiersEventListener : DefaultSaveEventListener
{
...
I'm a frequent SQL Server Management Studio user. Sometimes I'm in situations where I have an update or delete query to run, but I'm afraid some typo or logic error on my part is going to cause me to make undesired, massive changes to a table (like change 1000 rows when I meant to change 2).
In the past, I would just clench my fists ...
Considering the following code blocks, why does call to HQL work but call to delete() not work? As a background, I'm using NHibernate over IBM.Data.DB2.Iseries driver. Come to find out, journaling on the AS400 is turned off so I can't use transactions. I'm not the AS400 admin or know anything about it so I don't know if having journaling...
(Note: this is for MS SQL Server)
Say you have a table ABC with a primary key identity column, and a CODE column. We want every row in here to have a unique, sequentially-generated code (based on some typical check-digit formula).
Say you have another table DEF with only one row, which stores the next available CODE (imagine a simple ...
In our project we're using TransactionScope's to ensure our data access layer performs it's actions in a transaction. We're aiming to not require the MSDTC service to be enabled on our end-user's machines.
Trouble is, on half of our developers machines, we can run with MSDTC disabled. The other half must have it enabled or they get th...
Hello,
I have a counter field in a myisam table. To update the counter value in a multitasking environment (web server, concurrent queries from PHP) I need to lock the record for update.
So I do it like this:
START TRANSACTION;
SELECT Counter FROM mytable ... FOR UPDATE;
UPDATE Counter value or INSERT INTO mytable;
// let's make s...
I've noticed that rufus-tokyo and other apis support transactions in Tokyo Tyrant. I couldn't find any mention of the transaction support in the TT docs (http://1978th.net/tokyotyrant/spex.html#clientprog)
Is that transaction support simulated? Or is there a way to do a server-side transaction using the C api?
...
Under what circumstances can code wrapped in a System.Transactions.TransactionScope still commit, even though an exception was thrown and the outermost scope never had commit called?
There is a top-level method wrapped in using (var tx = new TransactionScope()), and that calls methods that also use TransactionScope in the same way.
I'm...
I'm refactoring some code, converting a number of related updates into a single transaction.
This is using JDBC, MySQL, InnoDB.
I believe there is an unwanted COMMIT still happening somewhere in the (rather large and undocumented) library or application code.
What's the easiest way to find out where this is happening?
There must be s...
I use one table withe some casual columns such as id, name, email, etc...also I'm inserting a variable numbers of records in each transaction, to be much efficient I need to have one unique id lets call it transaction id, that would be the same for each group of data which are inserted in one transaction, should be increment. What is the...
I'm looking for a way to continue execution of a transaction despite errors while inserting low-priority data. It seems like real nested transaction could be a solution, but they aren't supported by SQL Server 2005/2008. Another solution would be to have logic to decide if an error is critical or not, but it would seem that's not possibl...
Hi all!
I have a mysql table that contains IPAddress parts
TABLE `EndPoints`(
`EndPointId` BIGINT(19) UNSIGNED NOT NULL AUTO_INCREMENT ,
`IpPart1` TINYINT(3) UNSIGNED NOT NULL ,
`IpPart2` TINYINT(3) UNSIGNED NOT NULL ,
`IpPart3` TINYINT(3) UNSIGNED NOT NULL ,
`IpPart4` TINYINT(3) UNSIGNED NOT NULL ,
PRIMARY KEY ...
I am trying to work out the best way to stop double 'booking' in my application.
I have a table of unique id's each can be sold only once.
My current idea is to use a transaction to check if the chosen products are available, if they are then insert into a 'status' column that it is 'reserved' along with inserting a 'time of update' th...
I am dealing with Sql Server and Oracle through Qt, when using QSqlDatabase::transaction() on a database connection. When another user/connection has a transaction open on the same database does the transaction() call block until the other transaction is finished or fail ?
...