transactions

mysql index question

I am fighting with lock timeout problem on mysql right now. The front-end code is in Ruby on Rails, which updates some tables. In mysql log, I see things like the following Transaction 1 ... process no 3353, OS thread id 1094527296 inserting INSERT INTO ... (caused by code in Ruby on Rails) record lock for index 'PRIMARY' table 'A...

Is it ok to fire events from Dispose()?

In my current project I'm using classes which implement the following ITransaction interface shown below. This is a generic interface for a transaction that can be undone. I also have a TransactionSet class which is used to attempt multiple Transactions or TransactionSets, and can ultimately be used to create a tree of transactions. So...

What are the Transactional Boundaries for Command Handlers and Execution?

Let's take an example UI for editing Customer information. The user edits 5 fields and presses "submit". Because we're good abstractionists, we've taken the edits to the 5 fields and make them different commands (describing the edit to a particular field). The command handlers end up setting properties on objects that are persisted with...

SEAM Transactions in Weblogic

Hello, I am trying to use SEAM managed transactions in my application (using in components.xml) deployed in Weblogic 10.3. The application deploys succesfully but when I load the start page it is never loaded. Does anyone have a clue why this is happening? Thank you. ...

Seam-managed transactions how-to

Seam advises using an Extended persistent context in a Stateful Session Bean, in order to have Seam-managed persistence. I am not clear on whether the above advice casts any implications on the way we want to have Seam-managed transactions. This is because our architecture is different. We have the following persistence context in a St...

What is the correct usage of the Seam @Transational annotaion?

I'm a bit confused about the meaning of values used in the @Transactional annotation, specifically @TransactionPropagationType. Perhaps Gavin thought it would be obvious enough from the name of each enum type and decided not to document the actual meaning... Be that as it may I have no clue what any of the following actually mean: MANDAT...

Provider and subscriber in SQL Server 2008, can subscriber handle insert/delete?

Assuming I did all that is needed (consider complete replication) Make server "A" the provider and server "B" the subscriber Question: If I want to add, delete, update, or insert data, will I be able to do that by connecting to the subscriber? If yes, will the data change be automatically reflected in the provider? Using: C#, ASP....

How do I open a transacted file in C#

I understand W7 support transacted files. How do I use them in C#? ...

Does the .net TransactionScope handle very complicated database things?

I am tasked with proving or disproving the transaction support in .net. We all know that the TransactionScope can handle committing/rolling back simple things like inserting 3 records in 3 different tables and then deleting 5 records in 5 other tables. My team is not so sure that TransactionScope can handle the transaction properly if t...

how to Reference the variable via db.run_in_transaction on google-app-engine .

this is my code: class A(db.Model): a=db.StringProperty() class demo(BaseRequestHandler): def get(self): a='' def fn(): global a a=A(a='www') a.put() db.run_in_transaction(fn) raise Exception(a.key()) and the error is : raise Exception(a.key()) AttributeErr...

How to create temporary tables in Hibernate?

Goal Invoke a CREATE TEMPORARY TABLE statement in Hibernate without using native SQL. That means using HQL or Hibernate APIs only. Save objects to the temporary table. Invoke a stored procedure which makes use of existing tables and the temporary table. DROP the temporary table when finished. (I know it's not necessary, but I think it'...

PostgreSQL 'Deferrable Delete' still hits constraint on Delete

I want to delete rows from two tables which have a dependence upon each other through a set of deferrable constraints. To simplify this post, I've mocked up a simple DB schema. I'm hoping to remove entries from some table, 'delete_from_me', inside a SQL transaction/DB Patch. The catch is, I want to delete based on a select from a second...

MySQL Transaction From PHP

QUERY 1: $link = mysql_connect('localhost', 'root', ''); mysql_select_db('rems', $link); mysql_query('SET AUTOCOMMIT=0; START TRANSACTION', $link); mysql_query('DELETE FROM admins WHERE admin_id=4', $link); mysql_query('ROLLBACK; SET AUTOCOMMIT=1', $link); QUERY 2: $link = mysql_connect('localhost', 'root', ''); mysql_select_db('rems...

Spring: separate datasource for read-only transactions

Thanks for reading this. I have 2 MySQL databases - master for writes, slave for reads. The perfect scenario I imagine is that my app uses connection to master for readOnly=false transactions, slave for readOnly=true transactions. In order to implement this I need to provide a valid connection depending on the type of current transacti...

How to translate transaction dependant code into non transaction dependant code?

I've heard a couple months ago that Amazon was inclined to change all of its transactional shipping code (which also has another problem, they are distributed aka "sharded") into non transactional code. some_buy_method() check_item_stock() remove_item_from_stock() add_to_order() end ...

Transactionscope

Where can I reference TransactionScope? What is it used for? Where can I have information related to that? Can it be used to solve nested transactions? ...

Debugging transactions with Glassfish 2.1

Occasionally, I get following exception when running my Java EE application with Glassfish: Error in allocating a connection. Cause: java.lang.IllegalStateException: Local transaction already has 1 non-XA Resource: cannot add more resources. The application uses a single JDBC connection pool that is not XA-capable. However, I was not...

Getting all Ids that were inserted outside the transaction scope

Is it possible that after closing a transaction scope, we can obtain an array of ids containing all the ids inserted inside that transaction scope? If yes, how? ...

Logging JDBC/Hibernate/JPA transaction isolation levels

I'm working on a Flex/BlazeDS/Spring/JPA/Hibernate web application hooked up to a Microsoft SQL Server database. It seems to be locking the tables too aggresively. From my research, it looks like using the snapshot isolation policy is the best bet. I've set things up as such: <bean id="entityManagerFactory" class="org.springf...

Should I always use transactions in nhibernate (even for simple reads and writes)?

I know that for multi part writes, I should be using transactions in nhibernate. However what about for simple read and writes (1 part) ... I've read that it's good practice to always use transactions. Is this required? Should I do the following for a simple read ?? or can I just drop the transcaction part all togather ? public P...