transactions

Spring user transaction with hibernate

I want to control hibernate transaction myself so I can rollback at any time. I calling a thread to do business but not waiting for it to finish its job and update DB. This update is only available when the method ends but I want to commit changes in each for loop so I need to control hibernate transaction. My Sample code is below: for...

WAS 6.1, Hibernate, Spring and transaction managmement configuration

I'm using Websphere Application Server Express v6.1 and am writing an application which uses Spring 2.0.7, Hibernate 3.5. My datasource is Oracle 10g. I have 2 question Which is a better transaction manager? Websphere's or Hibernate's? If IBM is the answer then how should I configure it in the spring config XML? This is my current d...

EDI X12 standard - Where can I find a definition for this?

I've got a project I took over from someone that requires data to be exported in the EDI X12 Standard (837P) format. Although I have been able to find some samples that are useful I haven't been able to find anything that defines what the possible "segments" are and what they mean. The previous developer has quite a bit of work done, but...

What does a transaction around a single statement do?

I understand how a transaction might be useful for co-ordinating a pair of updates. What I don't understand is wrapping single statements in transactions, which is 90% of what I've ever seen. In fact, in real life code it is more common in my experience to find a series of logically related transactions each wrapped in their own transa...

MS Access: Avoiding "Lost Updates"

We've inherited a rather large Access DB that has some very strange (and unsettling) behaviour: Some updates to the database are lost. What can we do to avoid this? Are there any settings in Access to provide better transactional control? Here are some more details: We have one access user that has write access (shared by a very limit...

Hibernate multi level of transaction

hi every one, I have some hibernate code and I want my code run in 1 transaction let me explain in code public void changeBranch(Branch branch) throws DatabaseException { //some code humanDao.update(he); superBranchUsername = branch.getFatherUsername(); int superBranchId = branchDao.getBranchIdByUserN...

FMDB transaction

Hi ! I use FMDB to wrap SQLite in my app. I haven't found any docs about the use of methods begin, beginUpdates, commit, finalize, etc. I face some problems in my apps which i think are caused by the way i use transactions. Here is what i tried : [FMDB beginUpdates] - My insert statement - [FMDB commit] [FMDB finalize] it crashes wi...

How do I do nested transactions in NHibernate?

Can I do nested transactions in NHibernate, and how do I implement them? I'm using SQL Server 2008, so support is definitely in the DBMS. I find that if I try something like this: using (var outerTX = UnitOfWork.Current.BeginTransaction()) { using (var nestedTX = UnitOfWork.Current.BeginTransaction()) { ... do stuff ...

Sending several ExecuteNonQuery() to same database, which transaction type and error checking to use? (.NET)

I have an asp.net web site which will send several ExecuteNonQuery() statements (stored proc) to the same database (Sql server 2005). MSDTC service is turned off on both web and database servers. These statements need to run all successfully, all or none. So I need to wrap them in transaction. Is the best way to use SQLTranscation? Atta...

SharePoint: How to create/delete multiple items in a transaction

Hi I am trying to delete multiple items in a sharepoint list. But the constraint is : either all the items should be deleted or not a single item should be delted.In short I am looking for trasactional behavior in SharePoint.I tried to use ProcessBatchData() function. But it seems that it doesnt fulfill my requirement. Is there any othe...

Is it possible to Mock a Database Transaction parameter?

I'm trying to unit-test my implementation of an interface, and I'm having a little difficulty successfully mocking out a SqlTransaction parameter to one of the interface methods. Here's what the interface, and method under test that I'm interested in look like.. public class MyInterface { void MyMethod(SqlTransaction SharedTransact...

Help with a reusable JPA transaction method w/ rollback

I am retro-fitting transaction rollback support to a JPA-based java application, and am using Ecmel Ercans's approach to handling rollback (http://weblogs.java.net/blog/davidvc/archive/2007/04/jpa_and_rollbac.html) and JPA's kinks connected to rollbacks. It looks something like this: EntityManager em = emf.createEntityManager(); EntityT...

Managing SQL database connections accross many transactions

Hello, we have a DAL that needs to wrap many database inserts in a single transaction that we can rollback or commit. What is the best practice for handling that? We are currently doing the following: Create DB Connection and Transaction Fill a collection with all the classes that represent an action to perform. Pass in the conn...

Django transaction.commit_on_success not rolling back transaction

I'm trying to use Django transactions on MySQL with the commit_on_success decorator. According to the documentation, "If the function raises an exception, though, Django will roll back the transaction." However, this doesn't seem to work for me: >>> @transaction.commit_on_success ... def fails(): ... Site.objects.create(name="New ...

ETL as a transaction

For all the ETLs I have written so far, I have never made them transactions - i.e. if table 4 fails, roll everything back. What is the best practice in this regard? To "BeginTran + Commit" or not to "BeginTran + Commit" EDIT: I have one master package calling 4 other packages - is it possible to roll them all up into one transaction? ...

Is there a way to create an ADO.NET connection and ignore the ambient Transaction?

I have a situation where I am running in a WCF service that has TransactionScopeRequired=true, which means there will always be an ambient transaction. However, I need to start a new connection that will be around for the lifetime of the application, which means I can't have it use the abmbient transaction. Any ideas on how to do this?...

Hibernate transaction duplicate problem

Hi every one, I want update some of my table in database and want all of these work do in 1 transaction, first of all I delete some entry in branchbuildin(Table) and Insert new one after this action The problem occurred when I insert and entry with same buildingname and branch_fk (be cause I have this constraint on this table ( uniqueCon...

Sharing JMS and Hibernate transactions in a Spring MDB using Oracle Streams AQ?

I'm using Oracle 11g for my database and its Oracle Streams AQ feature as JMS implementation. For all I know, it should be possible to implement a Spring based message-driven POJO (MDP) that uses the same data source for both transactional data access and JMS transactions -- all without XA-Transactions (IIRC, this was marketed as a feat...

EJB 3 Transaction attribute for read only method

I have a method that returns lot of data, should I use @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) for this method. The method perform a JPA query an loads the full content of a table (about 1000 rows). ...

Relying on db transaction rollback in sunshine scenario

In a financial system I am currently maintaining, we are relying on the rollback mechanism of our database to simulate the results of running some large batch jobs - rolling back the transaction or committing it at the end, depending on whether we were doing a test run. I really cannot decide what my opinion is. In a way I think this is...