Search Results

Search found 1380 results on 56 pages for 'transactions'.

Page 6/56 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Subsonic 3 Simple Repository And Transactions

    - by ChrisKolenko
    Hey everyone, So this is what I have so far. Am I doing something wrong or is there a bug in 3.0.0.3? var Repository = new SimpleRepository("DBConnectionName"); using (TransactionScope ts = new TransactionScope()) { using (SharedDbConnectionScope scs = new SharedDbConnectionScope("connstring", "providerName")) { try { for (int i = 0; i < 5; i++) { Supplier s = new Supplier(); s.SupplierCode = i.ToString(); s.SupplierName = i.ToString(); Repository.Add<Supplier>(s); } ts.Complete(); } catch { } } } I'm getting an error in SubSonic DbDataProvider public DbConnection CurrentSharedConnection { get { return __sharedConnection; } protected set { if(value == null) { __sharedConnection.Dispose(); etc.. __sharedConnection == null :( Object Null Reference Exception :(

    Read the article

  • FMDB transaction

    - by user142764
    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 with this log : Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[FMDatabase<0xd705a0 finalize]: called when collecting not enabled' Could you please give me an example of how you are using transactions, or point me to a doc ? Thanks in advance, Vincent.

    Read the article

  • Distributed Transactions in SQL Server 2005

    - by AJM
    As part of a transaction I’m modifying rows in tables via a server link, so have to specify “SET XACT_ABORT ON” in my sproc otherwise it won’t execute. Now I’m noticing that SCOPE_IDENTITY() is returning NULL, which is presumably something to do with the distributed transaction scope? Does anyone know why and how to resolve?

    Read the article

  • Interface Design Problem: Storing Result of Transactions

    - by jboyd
    Requirements: multiple sources of input (social media content) into a system multiple destinations of output (social media api's) sources and destinations WILL be added some pseudo: IContentProvider contentProvider = context.getBean("contentProvider"); List<Content> toPost = contentProvider.getContent(); for (Content c : toPost) { SocialMediaPresence smPresence = socialMediaService.getSMPresenceBySomeId(c.getDestId()); smPresence.hasTwitter(); smPresence.hasFacebook(); //just to show what this is smPresence.postContent(c); //post content could fail for some SM platforms, but shoulnd't be lost forever } So now I run out of steam, I need to know what content has been successfully posted, and if it hasn't gone too all platforms, or if another platform were added in the future that content needs to go out for it as well (therefore my content provider will need to not only know if content has gone out, but for what platforms). I'm not looking for code, although sample/pseudo is fine... I'm looking for an approach to this problem that I can implement

    Read the article

  • MySQL Insert Statement Queue

    - by Justin
    We are building an ajax application in which a users input is submitted for processing to a php script. We are currently writing every request to a log file for tracking. I would like to move this tracking into a database table but I do not want to run a insert statement after request. What I would like to do is set up a 'queue' of transactions (inserts and updates) that need to be processed on the MySQL database. I would then set up a cron job or process to check and process the transactions in the queue. Is there something out there that we could build upon or do we have to just write to plain ol' text log files and process them?

    Read the article

  • Django - transactions in the model?

    - by orokusaki
    Models (disregard typos / minor syntax issues. It's just pseudo-code): class SecretModel(models.Model): some_unique_field = models.CharField(max_length=25, unique=True) # Notice this is unique. class MyModel(models.Model): secret_model = models.OneToOneField(SecretModel, editable=False) # Not in the form spam = models.CharField(max_length=15) foo = models.IntegerField() def clean(self): SecretModel.objects.create(some_unique_field=self.spam) Now if I go do this: MyModel.objects.create(spam='john', foo='OOPS') # Obviously foo won't take "OOPS" as it's an IntegerField. #.... ERROR HERE MyModel.objects.create(spam='john', foo=5) # So I try again here. #... IntegrityError because SecretModel with some_unique_field = 'john' already exists. I understand that I could put this into a view with a request transaction around it, but I want this to work in the Admin, and via an API, etc. Not just with forms, or views. How is it possible?

    Read the article

  • Can I specify the order of how changes happen in an single App Engine transaction ? Is it equal to t

    - by indiehacker
    If I passed a list of key ids as an argument in a transaction, would the change associated with the first key in the list happen first? And if not, how do I specify the order that I want the changes to happen in? As a concrete example, consider this code below from Google Docs Transactions--would changes to the first item in acc.key() happen first? class Accumulator(db.Model): counter = db.IntegerProperty() Docshttp://code.google.com/appengine/docs/python/datastore/transactions.html: def increment_counter(key, amount): obj = db.get(key) obj.counter += amount obj.put() q = db.GqlQuery("SELECT * FROM Accumulator") acc = q.get() db.run_in_transaction(increment_counter, acc.key(), 5)

    Read the article

  • SQL Server, Remote Stored Procedure, and DTC Transactions

    - by marc
    Our organization has a lot of its essential data in a mainframe Adabas database. We have ODBC access to this data and from C# have queried/updated it successfully using ODBC/Natural "stored procedures". What we'd like to be able to do now is to query a mainframe table from within SQL Server 2005 stored procs, dump the results into a table variable, massage it, and join the result with native SQL data as a result set. The execution of the Natural proc from SQL works fine when we're just selecting it; however, when we insert the result into a table variable SQL seems to be starting a distributed transaction that in turn seems to be wreaking havoc with our connections. Given that we're not performing updates, is it possible to turn off this DTC-escalation behavior? Any tips on getting DTC set up properly to talk to DataDirect's (formerly Neon Systems) Shadow ODBC driver?

    Read the article

  • HTML5 Database Transactions

    - by jiewmeng
    i am wondering abt the example W3C Offline Web Apps the example function renderNotes() { db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Notes(title TEXT, body TEXT)', []); tx.executeSql(‘SELECT * FROM Notes’, [], function(tx, rs) { for(var i = 0; i < rs.rows.length; i++) { renderNote(rs.rows[i]); } }); }); } has the create table before the 'main' executeSql(). will it be better if i do something like $(function() { // create table 1st db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Notes(title TEXT, body TEXT)', []); }); // when i execute say to select/modify data, i just do the actual action db.transaction(function(tx) { tx.executeSql(‘SELECT * FROM Notes’, [], function(tx, rs) { ... } }); db.transaction(function(tx) { tx.executeSql(‘INSERT ...’, [], function(tx, rs) { ... } }); }) i was thinking i don't need to keep repeating the CREATE IF NOT EXISTS right?

    Read the article

  • SQL Server Transactions how can I commit my transaction

    - by codingguy3000
    I have SQL Server 2005 stored procedure. Someone one is calling my stored procedure within a transaction. In my stored proc I'm logging some information (insert into a table). When the higher level transaction rolls back it removes my insert. Is there anyway I can commit my insert and prevent the higher level rollback from removing my insert? Thanks

    Read the article

  • Multi-property "transactions" in Core Data / NSManagedObject / NSFetchedResultsController?

    - by Martijn Thé
    Hi, Is it possible to set multiple properties of an NSManagedObject and have the NSFetchedResultsController call controllerDidChangeContent: only once? In other words, is it possible to say something like: [managedObject beginChanges]; [managedObject setPropertyA:@"Foo"]; [managedObject setPropertyB:@"Bar"]; [managedObject commitChanges]; and then have the NSFetchedResultsController call controllerDidChangeContent: (and the other methods) only one time? Thanks!

    Read the article

  • c source code to remove subset transactions form text file

    - by user324887
    I have a file containing data as follows 10 20 30 40 70 20 30 70 30 40 10 20 29 70 80 90 20 30 40 40 45 65 10 20 80 45 65 20 I want to remove all subset transaction from this file. output file should be like follows 10 20 30 40 70 29 70 80 90 20 30 40 40 45 65 10 20 80 Where records like 20 30 70 30 40 10 20 45 65 20 are removed because of they are subset of other records.

    Read the article

  • c source code to remove subset transactions from text file

    - by user324887
    I have a file containing data as follows 10 20 30 40 70 20 30 70 30 40 10 20 29 70 80 90 20 30 40 40 45 65 10 20 80 45 65 20 I want to remove all subset transaction from this file. output file should be like follows 10 20 30 40 70 29 70 80 90 20 30 40 40 45 65 10 20 80 Where records like 20 30 70 30 40 10 20 45 65 20 are removed because of they are subset of other records.

    Read the article

  • removing subset transactions form file

    - by user324887
    I have a file containing data as follows 10 20 30 40 70 20 30 70 30 40 10 20 29 70 80 90 20 30 40 40 45 65 10 20 80 45 65 20 I want to remove all subset transaction from this file. output file should be like follows 10 20 30 40 70 29 70 80 90 20 30 40 40 45 65 10 20 80 Where records like 20 30 70 30 40 10 20 45 65 20 are removed because of they are subset of other records.

    Read the article

  • Cocoa's newbie question: is it possible to bind a NSTableView's selection to another tableview's selection?

    - by cocoaOverloaded
    http://img651.imageshack.us/img651/6999/modelsf.jpg Let'say, I've 2 entities in the Core Data's Model file, one being all "transactions" ever done by X company. The "transactions" entity has among other properties, a "DATE" property and a to-one relationship "COMPANY"(specifying the company with which X company has done that particular transaction). The other entity:"companies" of course contains all the companies' info ,with which X company has done transaction. The "companies" entity has a to-many relationships "TRANSACTIONS" which is an inverse relationship to "transactions" entity's "COMPANY" relationship. So within IB, I created a NSTableView(with its own NSArrayController) showing all the transactions on a particular Date (with the help of NSPredicate). Then I create another table view showing the to-many relationship "TRANSACTIONS" of the company of the selected transaction in the first table view(which shows transactions on a particular date). The 2nd table view's NSArrayController binding is like this: ** bind to: "name of the first tableview's controller", Controller Key: selection, Model Key Path:COMPANY.TRANSACTIONS(the to-many relationship in the "companies" entity)** Everythings work fine up to this moment, the 2nd tableview shows all the transactions X company has done with the company of the selected transactions in the 1st table view. But I have a group of textfields showing details of a particular transactions. Binding the these textfields with the controller of the 1st table view(the one showing transactions on a particular date) is pretty straightforward. But what I want to do are: 1/ Look up the transactions on a particular date in the first table view, select any one of them 2/ Then, check all previous transactions of the company of that transaction( selected in the first table view) from the 2nd table view 3/ Select any previous transactions and check the details of the transaction from that group of textfields So naturally I should have bind the textfields' gp to the 2nd table view's controller. But I found the default selected row in the 2nd table view(the one show all previous transactions of a company) wasn't the transaction I've selected in the 1st tableView for a particular date. Of course, i can manually select that transaction in the 2nd table view again.... So I just want to know if it's possible to have the 2nd table view automatically select the transaction according to the transaction I've selected in the 1st table view thr binding?? After hours of googling, I solved the problem by implementing the tableview Delegate protocol: - (void)tableViewSelectionDidChange:(NSNotification *)aNotification { if (["nameOf1stTableView" selectedRow] > -1) { NSArray *objsArray = ["nameOf2ndTableView'sController" arrangedObjects]; for (id obj in objsArray) { if ([[obj valueForKey:@"DATE"] isEqualToDate: ["nameOf1stTableView'sController".selection valueForKey:@"DATE"]]) { ["nameOf2ndTableView" selectRowIndexes:[NSIndexSet indexSetWithIndex:[objsArray indexOfObject:obj]] byExtendingSelection:NO]; } } } } But,this just look too cumbersome... can it be done with binding alone? Thanks in Advance,

    Read the article

  • How do I delete in Django? (mysql transactions)

    - by alex
    If you are familiar with Django, you know that they have a Authentication system with User model. Of course, I have many other tables that have a Foreign Key to this User model. If I want to delete this user, how do I architect a script (or through mysql itself) to delete every table that is related to this user? My only worry is that I can do this manually...but if I add a table , but I forget to add that table to my DELETE operation...then I have a row that links to a deleted, non-existing User.

    Read the article

  • SQL SERVER – Repair a SQL Server Database Using a Transaction Log Explorer

    - by Pinal Dave
    In this blog, I’ll show how to use ApexSQL Log, a SQL Server transaction log viewer. You can download it for free, install, and play along. But first, let’s describe some disaster recovery scenarios where it’s useful. About SQL Server disaster recovery Along with database development and administration, you must work on a good recovery plan. Disasters do happen and no one’s immune. What you can do is take all actions needed to be ready for a disaster and go through it with minimal data loss and downtime. Besides creating a recovery plan, it’s necessary to have a list of steps that will be executed when a disaster occurs and to test them before a disaster. This way, you’ll know that the plan is good and viable. Testing can also be used as training for all team members, so they can all understand and execute it when the time comes. It will show how much time is needed to have your servers fully functional again and how much data you can lose in a real-life situation. If these don’t meet recovery-time and recovery-point objectives, the plan needs to be improved. Keep in mind that all major changes in environment configuration, business strategy, and recovery objectives require a new recovery plan testing, as these changes most probably induce a recovery plan changing and tweaking. What is a good SQL Server disaster recovery plan? A good SQL Server disaster recovery strategy starts with planning SQL Server database backups. An efficient strategy is to create a full database backup periodically. Between two successive full database backups, you can create differential database backups. It is essential is to create transaction log backups regularly between full database backups. Keep in mind that transaction log backups can be created only on databases in the full recovery model. In other words, a simple, but efficient backup strategy would be a full database backup every night, a transaction log backup every hour, or every 15 minutes. The frequency depends on how much data you can afford to lose and how busy the database is. Another option, instead of creating a full database backup every night, is to create a full database backup once a week (e.g. on Friday at midnight) and differential database backup every night until next Friday when you will create a full database backup again. Once you create your SQL Server database backup strategy, schedule the backups. You can do that easily using SQL Server maintenance plans. Why are transaction logs important? Transaction log backups contain transactions executed on a SQL Server database. They provide enough information to undo and redo the transactions and roll back or forward the database to a point in time. In SQL Server disaster recovery situations, transaction logs enable to repair a SQL Server database and bring it to the state before the disaster. Be aware that even with regular backups, there will be some data missing. These are the transactions made between the last transaction log backup and the time of the disaster. In some situations, to repair your SQL Server database it’s not necessary to re-create the database from its last backup. The database might still be online and all you need to do is roll back several transactions, such as wrong update, insert, or delete. The restore to a point in time feature is available in SQL Server, but for large databases, it is very time-consuming, as SQL Server first restores a full database backup, and then restores transaction log backups, one after another, up to the recovery point. During that time, the database is unavailable. This is where a SQL Server transaction log viewer can help. For optimal recovery, besides having a database in the full recovery model, it’s important that you haven’t manually truncated the online transaction log. This ensures that all transactions made after the last transaction log backup are still in the online transaction log. All you have to do is read and replay them. How to read a SQL Server transaction log? SQL Server doesn’t provide an option to read transaction logs. There are several SQL Server commands and functions that read the content of a transaction log file (fn_dblog, fn_dump_dblog, and DBCC PAGE), but they are undocumented. They require T-SQL knowledge, return a large number of not easy to read and understand columns, sometimes in binary or hexadecimal format. Another challenge is reading UPDATE statements, as it’s necessary to match it to a value in the MDF file. When you finally read the transactions executed, you have to create a script for it. How to easily repair a SQL database? The easiest solution is to use a transaction log reader that will not only read the transactions in the transaction log files, but also automatically create scripts for the read transactions. In the following example, I will show how to use ApexSQL Log to repair a SQL database after a crash. If a database has crashed and both MDF and LDF files are lost, you have to rely on the full database backup and all subsequent transaction log backups. In another scenario, the MDF file is lost, but the LDF file is available. First, restore the last full database backup on SQL Server using SQL Server Management Studio. I’ll name it Restored_AW2014. Then, start ApexSQL Log It will automatically detect all local servers. If not, click the icon right to the Server drop-down list, or just type in the SQL Server instance name. Select the Windows or SQL Server authentication type and select the Restored_AW2014 database from the database drop-down list. When all options are set, click Next. ApexSQL Log will show the online transaction log file. Now, click Add and add all transaction log backups created after the full database backup I used to restore the database. In case you don’t have transaction log backups, but the LDF file hasn’t been lost during the SQL Server disaster, add it using Add.   To repair a SQL database to a point in time, ApexSQL Log needs to read and replay all the transactions in the transaction log backups (or the LDF file saved after the disaster). That’s why I selected the Whole transaction log option in the Filter setup. ApexSQL Log offers a range of various filters, which are useful when you need to read just specific transactions. You can filter transactions by the time of the transactions, operation type (e.g. to read only data inserts), table name, SQL Server login that made the transaction, etc. In this scenario, to repair a SQL database, I’ll check all filters and make sure that all transactions are included. In the Operations tab, select all schema operations (DDL). If you omit these, only the data changes will be read so if there were any schema changes, such as a new function created, or an existing table modified, they will be ignored and database will not be properly repaired. The data repair for modified tables will fail. In the Tables tab, I’ll make sure all tables are selected. I will uncheck the Show operations on dropped tables option, to reduce the number of transactions. Click Next. ApexSQL Log offers three options. Select Open results in grid, to get a user-friendly presentation of the transactions. As you can see, details are shown for every transaction, including the old and new values for updated columns, which are clearly highlighted. Now, select them all and then create a redo script by clicking the Create redo script icon in the menu.   For a large number of transactions and in a critical situation, when acting fast is a must, I recommend using the Export results to file option. It will save some time, as the transactions will be directly scripted into a redo file, without showing them in the grid first. Select Generate reconstruction (REDO) script , change the output path if you want, and click Finish. After the redo T-SQL script is created, ApexSQL Log shows the redo script summary: The third option will create a command line statement for a batch file that you can use to schedule execution, which is not really applicable when you repair a SQL database, but quite useful in daily auditing scenarios. To repair your SQL database, all you have to do is execute the generated redo script using an integrated developer environment tool such as SQL Server Management Studio or any other, against the restored database. You can find more information about how to read SQL Server transaction logs and repair a SQL database on ApexSQL Solution center. There are solutions for various situations when data needs to be recovered, restored, or transactions rolled back. Reference: Pinal Dave (http://blog.sqlauthority.com)Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • Default Transaction Timeout

    - by MattH
    I used to set Transaction timeouts by using TransactionOptions.Timeout, but have decided for ease of maintenance to use the config approach: <system.transactions> <defaultSettings timeout="00:01:00" /> </system.transactions> Of course, after putting this in, I wanted to test it was working, so reduced the timeout to 5 seconds, then ran a test that lasted longer than this - but the transaction does not appear to abort! If I adjust the test to set TransactionOptions.Timeout to 5 seconds, the test works as expected After Investigating I think the problem appears to relate to TransactionOptions.Timeout, even though I'm no longer using it. I still need to use TransactionOptions so I can set IsolationLevel, but I no longer set the Timeout value, if I look at this object after I create it, the timeout value is 00:00:00, which equates to infinity. Does this mean my value set in the config file is being ignored? To summarise: Is it impossible to mix the config setting, and use of TransactionOptions If not, is there any way to extract the config setting at runtime, and use this to set the Timeout property [Edit] OR Set the default isolation-level without using TransactionOptions

    Read the article

  • Is something along the lines of nested memoization needed here?

    - by Daniel
    System.Transactions notoriously escalates transactions involving multiple connections to the same database to the DTC. The module and helper class, ConnectionContext, below are meant to prevent this by ensuring multiple connection requests for the same database return the same connection object. This is, in some sense, memoization, although there are multiple things being memoized and the second is dependent on the first. Is there some way to hide the synchronization and/or mutable state (perhaps using memoization) in this module, or perhaps rewrite it in a more functional style? (It may be worth nothing that there's no locking when getting the connection by connection string because Transaction.Current is ThreadStatic.) type ConnectionContext(connection:IDbConnection, ownsConnection) = member x.Connection = connection member x.OwnsConnection = ownsConnection interface IDisposable with member x.Dispose() = if ownsConnection then connection.Dispose() module ConnectionManager = let private _connections = new Dictionary<string, Dictionary<string, IDbConnection>>() let private getTid (t:Transaction) = t.TransactionInformation.LocalIdentifier let private removeConnection tid = let cl = _connections.[tid] for (KeyValue(_, con)) in cl do con.Close() lock _connections (fun () -> _connections.Remove(tid) |> ignore) let getConnection connectionString (openConnection:(unit -> IDbConnection)) = match Transaction.Current with | null -> new ConnectionContext(openConnection(), true) | current -> let tid = getTid current // get connections for the current transaction let connections = match _connections.TryGetValue(tid) with | true, cl -> cl | false, _ -> let cl = Dictionary<_,_>() lock _connections (fun () -> _connections.Add(tid, cl)) cl // find connection for this connection string let connection = match connections.TryGetValue(connectionString) with | true, con -> con | false, _ -> let initial = (connections.Count = 0) let con = openConnection() connections.Add(connectionString, con) // if this is the first connection for this transaction, register connections for cleanup if initial then current.TransactionCompleted.Add (fun args -> let id = getTid args.Transaction removeConnection id) con new ConnectionContext(connection, false)

    Read the article

  • Implement custom JTA XAResource for using with hibernate

    - by jstingo
    I have two level access to database: the first with Hibernate, the second with JDBC. The JDBC level work with nontransactional tables (I use MyISAM for speed). I want make both levels works within transaction. I read about JTA which can manage distributed transactions. But there is lack information in the internet about how to implement and use custom resource. Does any one have experience with using custom XAResources?

    Read the article

  • Determining a transaction fee before an order is processed

    - by Kenji Crosland
    When users make credit card transactions on my web app, I'd like to include the transaction fee on the confirmation page before the user makes the order. The thing is, there are different transaction fees for different cards. Is there a way to determine a transaction fee from the card number? I'm using Rails and ActiveMerchant, but I figure this question was applicable to other languages as well.

    Read the article

  • SQL Query syntax, I want to use INNER JOIN

    - by amol kadam
    Hi . I'm working on a windows application project using front end "vb.net" & back end "Ms Access" I have problem in wrinting sql query Actually there are 5 tables Transaction,items,itemtitle,itemtype & userinfo. check the following query & with this referance if u get idea then plz change in correct query Thanking You SELECT TRANSACTIONS.ACCESSIONNO AS ACCESSIONNO,TRANSACTIONS.TYPEID, TRANSACTIONS.CHECKOUTDATE AS CHECKOUTDATE,ITEMTITLE.ITEMTITLE, TRANSACTIONS.CHECKEDOUTBY, USERINFO.FULLNAME_ENG, USERINFO.FULLNAME_MAR, TRANSACTIONS.ACCOUNTNO, ITEMTYPE.TYPES_MAR, ITEMTYPE.TYPES_ENG FROM TRANSACTIONS,ITEMTYPE, ITEMTITLE, USERINFO WHERE TRANSACTIONS.ACCOUNTNO=USERINFO.ACCOUNTNO AND TRANSACTIONS.ACCESSIONNO=ITEMS.ACCESSIONNO AND ITEMS.ITEMTITLEID=ITEMTITLE.ITEMTITLEID AND TRANSACTIONS.TYPEID=ITEMTYPE.TYPEID AND TRANSACTIONS.STATUS='Enabled'

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >