Tag: 交易

PayPal API,找到合适的API

我需要在我的网站上添加使用PayPal付款的选项。 我想有一个API,我可以发送PayPal信息,然后马上回到交易ID,这样我就可以将它保存在我的数据库中。 什么API最适合我? 有没有办法做到这一点? 我看到他们有这个清单: 名单 你知道我能找到很好的例子吗? 我的应用程序是ASP.NET c#我知道这是一个非常初学的问题,我真的需要帮助。 谢谢 编辑我开始使用的东西但后来发现问题我在这里发布了一个新问题

使用亚音速交易

在我的Web应用程序中,我要继续审核用户操作。 因此,每当用户执行操作时,我都会更新执行操作的对象,并保留该操作的审计跟踪。 现在如果我先修改对象然后更新审计跟踪但审计跟踪失败那么呢? 显然我需要回滚对修改过的对象的更改。 我可以在简单的应用程序中使用Sql-Transactions,但我使用Subsonic与db通信。 我怎么能处理这种情况?

C#中的交易

首先,这不是关于数据库事务的post。 我想更多地了解.NET 2.0及更高版本中的TransactionModel 。 由于我正在针对.NET 3.5进行开发,因此新版本的应用程序会受到关注。 现在,我想要实现的是以下内容 public void Withdraw(double amount) { using (TransactionScope scope = new TransactionScope()) { Money -= amount; if (Money > 0) scope.Complete(); } } 这意味着当Money小于0时, TransactionScope内的所有内容都应该是RolledBack,但事实并非如此。 一个简单的测试如下 ImportantObject obj = new ImportantObject(1); Console.WriteLine(obj.Money); obj.Withdraw(101); Console.WriteLine(obj.Money); 前提是Stadard Money金额为100。 我在这里错过了什么,或者这不是交易应该如何运作的? 使用这个模型会有什么性能损失?

环境事务中的TransactionScope错误不会回滚事务

我使用这样的环境事务: using(TransactionScope tran = new TransactionScope()) { CallAMethod1();//INSERT CallAMethod2();//INSERT tran.Complete(); } 方法CallAMethod2(); 返回affected rows =-264因此无法插入但是第一个Insert已经提交! 我想知道如何使用ambient transaction ,如果第二种方法有多个需要内部事务的操作,我应该将这些操作放在内部事务中吗? 像这样 : DAL_Helper.Begin_Transaction(); //——Fill newKeysDictioanry affectedRow = DBUtilities.InsertEntityWithTrans(“table2”, newKeysDictioanry, DAL_Helper); if (affectedRow == 1) { if (!string.IsNullOrEmpty(sp_confirm)) { result_dt = UserTransactionDAL.Run_PostConfirm_SP(sp_PostConfirm, OBJ.ValuesKey, DAL_Helper); if (result_dt.Rows.Count > 0 && result_dt.Rows[0][0].ToString() == “0”) { DAL_Helper.current_trans.Commit(); if (DAL_Helper.connectionState == ConnectionState.Open) […]

这个IfxTransaction已经完成; 它不再可用

问: 当我使用交易时,我会在每100条记录中约有1条出现以下错误。 这个IfxTransaction已经完成; 它不再可用 我不能指望错误发生的时间或错误的原因是什么。 我尝试在同一笔交易中插入约607记录。 我的代码: public static int InsertGroups(List groups) { DBConnectionForInformix con = new DBConnectionForInformix(“”); con.Open_Connection(); con.Begin_Transaction(); int affectedRow = -1; Dictionary groupsParameter = new Dictionary(); try { foreach (Group a in groups) { groupsParameter.Add(“id”, a.GroupId.ToString()); groupsParameter.Add(“name”, a.Name); groupsParameter.Add(“studentcount”, a.StudentCount.ToString()); groupsParameter.Add(“divisiontag”, a.DivisionTag.ToString()); groupsParameter.Add(“entireclass”, a.EntireClass.ToString()); groupsParameter.Add(“classid”, a.ClassId.ToString()); groupsParameter.Add(“depcode”, a.DepCode.ToString()); groupsParameter.Add(“studycode”, a.StudyCode.ToString()); groupsParameter.Add(“batchnum”, a.BatchNum.ToString()); […]

TransactionScope中的Membership.GetUser()抛出TransactionPromotionException

以下代码抛出TransactionAbortedException ,消息“事务已中止”,内部TransactionPromotionException ,消息“尝试提升事务时失败”: using ( TransactionScope transactionScope = new TransactionScope() ) { try { using ( MyDataContext context = new MyDataContext() ) { Guid accountID = new Guid( Request.QueryString[ “aid” ] ); Account account = ( from a in context.Accounts where a.UniqueID.Equals( accountID ) select a ).SingleOrDefault(); IQueryable loginList = from l in context.Logins where […]

我应该总是在nhibernate中使用事务(即使是简单的读写操作)吗?

我知道对于多部分写入,我应该在nhibernate中使用事务。 然而,对于简单的读写操作(1部分)…我已经读过,总是使用事务是一种好习惯。 这需要吗? 我应该做一下简单的阅读吗? 或者我可以将交易部分全部丢弃? public PrinterJob RetrievePrinterJobById(Guid id) { using (ISession session = sessionFactory.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { var printerJob2 = (PrinterJob) session.Get(typeof (PrinterJob), id); transaction.Commit(); return printerJob2; } } } 要么 public PrinterJob RetrievePrinterJobById(Guid id) { using (ISession session = sessionFactory.OpenSession()) { return (PrinterJob) session.Get(typeof (PrinterJob), id); } } 简单的写作怎么样? […]

entity framework和事务隔离级别

我正在使用Entity Framework 4.0。 现在我需要限制对表的访问,当我从中读取或写入它时。 可能是关于事务隔离级别的。 我怎么做? 更新 这就是我所拥有的 using (var db = new MyDb()) { using (TransactionScope scope = new TransactionScope()) { var item = db.MyItems.Single(x => x.Id == 5); item.Price = 12; db.SaveChanges(); scope.Complete(); } } 但是,当我在内部任何一行using (TransactionScope scope断点时using (TransactionScope scope ,当我停在那里然后我转到Sql Server Management Studio并从一个在内部使用的表中进行选择查询(甚至更新!))事务,我出于某种原因没有收到错误。但为什么呢?它不能让我在执行事务时读取数据。

Azure存储相关的API是否参与System.Transactions?

我无法在任何地方找到任何相关信息,但问题很简单。 我可以在TransactionScope包装与存储相关的操作,例如,如果存在回滚,则还会回滚上载的文件吗? 如果本机API不能这样做,那么在任何地方都有公共实现吗?

.NET中的TransactionScope错误? 更多信息?

我已经阅读过(或者从同事那里听到)在.NET中,TransactionScope可以达到超时,然后是VoteCommit(而不是VoteRollback)。 这是准确还是传闻? 我无法在网上找到谈论这个问题的信息(如果这是一个问题),所以我想知道是否有人有任何直接经验并且可以解决一些问题?