Questions tagged [transaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
28 views

Marketing Cloud Txn API | Whitelist my Webhook only for Marketing Cloud calls

If I implement a webhook, it basically allows anyone to call that endpoint. As this would be a public URL. From security point of view, I should only consume event notifications coming only from ...
0
votes
0answers
33 views

Query operations through the API throws error when Transaction security policies are enabled

An external ETL tools gets this error when querying data from Salesforce after transaction security policies are enabled. 'TXN_SECURITY_METERING_ERROR: We can't complete the action because enabled ...
0
votes
1answer
31 views

How to check the user logged in - from direct login or using api access or using Oauth? If so can I block that user accessing certain objects?

How to check the user logged in - from direct login or using api access or using Oauth? If so can I block that user accessing certain objects? Can I check the above using AuthSession object's ...
0
votes
2answers
103 views

Database.rollback() Method Not Working In Different Transaction?

I have created a very simple scenario where I'm creating a savepoint and trying to rolling back in future method. The behaviour is little confusing - I tried searching it over the net but I didn't ...
2
votes
1answer
88 views

Salesforce Relational Database ACID

I was reading about relational databases and found that Salesforce is built on Oracle's Relational Database. Based on my understanding, Relational Databases "promise" the following ACID principle: ...
2
votes
0answers
44 views

Why do we create a send definition in Marketing Cloud Transactional Email and then send it in second step

Why do we create a send definition in Marketing Cloud Transactional Email? In the steps of creating Transactional Email using Marketing Cloud API, it is given that first, create the Transactional ...
3
votes
1answer
61 views

Transaction Security is not available in Scratch Org

How am I able to turn on the visibility for transaction security? I am trying to test an apex class that implements TxnSecurity.PolicyCondition and according to this article to be able to see these ...
0
votes
1answer
48 views

Apex page failing DML transaction

Let's have a very simple apex page: <apex:page controller="EventInsert" > <apex:form> <p>Event insertion test</p> <p>{!processParams}</p> <apex:...
0
votes
4answers
821 views

Maximum number of records a trigger processes in a single batch?

What is the maximum number of records a trigger needs to be able to process in a single transaction/batch? Is it limited to 200? or do triggers need to be able to handle more?
0
votes
0answers
105 views

Performing multiple operations on same record in same transaction [duplicate]

I am trying to do three operation using same record. First Operation: Set ContentDocument isArchived field to false. Second Operation: Grab contentdocument by calling REST API Endpoint. Third ...
0
votes
1answer
170 views

What is the transaction boundary in apex and how the debug log files generated?

In Apex Developer Guide, I found An Apex transaction represents a set of operations that are executed as a single unit. My question is, how can I define the set of operations ? That is, If I ...
1
vote
1answer
185 views

Uncommited work exception in Queuable with Callback and Rollback

Is there a way to do all that Do Callout in Queueable Do Dml based on the Callout result Catch errors in 1 and 2. Rollback 1, 2 on error Report error via email and log in Custom object without ...
7
votes
2answers
497 views

Do Apex Transaction have a unique Id (like Batch Ids)?

I am working on a Platform Event based Logging Framework (based on the ideas of Andrew Fawcett's Dreamforce session). I want to visually group Log entries of the same transaction or batch. Batch ...
0
votes
1answer
452 views

Difference between Batch, Job and Transaction in Salesforce?

As a title, can anyone help me to distinguish what is the difference between Batch, Job and Transaction in Salesforce?
2
votes
1answer
112 views

Transaction security policy for multiple logins

I need to modify the existing transaction security policy to trigger if user logs in from multiple IP addresses in past 8 hours. I'm using the below SFDC example policy. Can someone give a hand on how ...
0
votes
1answer
119 views

Bulk flow interviews not interacting with one another

My goal is to run a flow in bulk and not create duplicates. First thing that happens is I lookup colCustomObject. The first interview loops through colCustomObject, determines that a new record needs ...
1
vote
2answers
342 views

method @future two transactions

In an @future method can I persist a data at the beginning of the execution and the others at the end? Pratically, can i open and close two different transactions in the same @future method?
1
vote
1answer
1k views

Is a single APEX test case considered a transaction?

I'm getting DML errors when trying to test some triggers: This error occurred: MIXED_DML_OPERATION: DML operation on setup object is not permitted after you have updated a non-setup object (or ...
1
vote
1answer
100 views

Confused with transaction terminology related to Visual flow limits

I am going through Apex Governor Limits that Affect Flows documentation and came across two new terms "larger transaction" and "batch transaction". I thought we only have Synchronous transaction, ...
3
votes
1answer
1k views

Explain: Big objects don’t support transactions including both big objects, standard object and custom objects

While reading the Big Object related documentation, I was curious as to what does the following statement mean? Big objects don’t support transactions including both big objects, standard object ...
0
votes
0answers
28 views

When are history records created

Two types of transactions work on a set of records. First type selects records that don't have a flag set and sets it. The second transaction selects those records that have a flag set and removes the ...
3
votes
2answers
468 views

Does Apex transaction control have a context or scope?

Is Apex transaction control equivalent to .Net transaction scope where it only rolls back the transaction within scope? Will it rollback all the records that has been inserted between Database....
0
votes
2answers
1k views

How to get and rethrow Exception from Database.insert(list, false)

I am inserting record using the allOrNothing = false option to only rollback the transaction when a certain type of error occurs (Goal: Allow the insert of Custom Records even if some of them fail as ...
9
votes
2answers
1k views

Aura transaction details

I have a fundamental question about Lightning technical design. Today viewing debug logs I noticed that if Lightning component make multiple calls to server-side (invoke multiple apex-controller ...
9
votes
1answer
800 views

How does Lightning Component Framework request boxcar'ing affect flows and transactions?

If the lightning component framework batches together multiple update requests, are they all subject to the rules and limits of a single transaction? From Queueing of Server Side Actions: The ...
1
vote
2answers
1k views

Remembering data between before trigger and after trigger

I want a before update trigger to remember which of the objects need something done in the after trigger handler. I tried this but I get a null reference: public class OpportunityTriggerHandler { ... ...
0
votes
1answer
48 views

How triggers start firing?

Is it guaranteed that when we create/update/delete two different records separately but in one time and from one user create/update/delete trigger fires twice? Or two these operation can be merged in ...
3
votes
1answer
679 views

Trigger.new List During a Transaction

This is a question I have always wondered. I have a series of classes and methods that modify the Trigger.new case list records as the list is handed off to each class and method. Apex goes down the ...
0
votes
0answers
20 views

Time-based workflows and triggered transactions [duplicate]

Say that there is a time based workflow on creation which updates something after 1 day. Two records are created via two different API calls (say we exposed a REST service), these two different calls ...
4
votes
2answers
281 views

Rollback Block?

I am curious what kind of syntax is Apex method System.runAs(){ } where in curly brackets I can run my code which will be executed as passed user. I would like to write my own method with that syntax ...
0
votes
1answer
165 views

Question about apex transaction

According to the documentation: An Apex transaction represents a set of operations that are executed as a single unit. All DML operations in a transaction either complete successfully, or if an ...
2
votes
1answer
128 views

Salesforce transaction mutexes

This is more of a theory question. We have a use case where an object field is the sum of the records existing in the system + 1. This method is going to be accessed via force remoting. My worry is ...
2
votes
1answer
650 views

Does Database.rollback work when encountering a Salesforce Limit Error

I am doing some testing on Salesforce Transaction controls and noticed something odd. I was wondering if I am missing something or if I am just not following 'best practices'. System.Savepoint sp = ...
7
votes
1answer
337 views

Is an AsyncApexJob record inserted immediately at the end of a transaction?

Is an AsyncApexJob record inserted immediately at the end of a transaction or is it possible that there is a delay between those two events? I couldn't find firm guarantee in the documentation on that....
0
votes
1answer
421 views

Database Class and DML in a transaction

According to the official document - https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_transaction.htm I understand that if there is any error in a transaction ...
1
vote
1answer
142 views

Mixed DML Operations in Test Methods - system.RunAs(user) - but why?

Reading the documentation here, the advice is to run certain DML operations within a System.runAs(user) block. I don't really understand why that needs to happen. I know that it works - as my unit ...
11
votes
1answer
2k views

When is a FOR UPDATE lock released?

The Salesforce docs say that The lock gets released when the transaction completes Does that mean when the record is updated, or when the execution context completes?
1
vote
0answers
93 views

Questions on row locking/transaction control

I have a process that first reads a custom setting value to use in a numbering scheme (can't use auto-number), it +1 that value, updates it, then does a number of DML/logic code which can take a ~2-10 ...
0
votes
1answer
45 views

Email One Click Buy

Does anyone have a suggestion how to implement a one-click purchase mechanism via SFMC email? Intending for a customer to receive an email, when they click the CTA button, it automatically ...
3
votes
3answers
692 views

Testing system rollback, i.e. when exception is thrown outside without handling

On our community website we have some logic which throws exception when some set of conditions is invalid. This exception is not handled by any part of our code. As result system rollback happens ...
2
votes
0answers
150 views

When does System.abortJob() take effect with regards to a transaction?

If I call System.abortJob() in a transaction, when is the job actually aborted? Does it happen immediately, or only once the transaction is committed? I suspect the latter, as you don't want to have ...
3
votes
1answer
94 views

Time Dependant Workflows and transactions

The environment setup is as follows: 1) there is a workflow triggered by some criteria which has a time dependent action which will update a field on the object. 2) With apex-code I update a List of ...
0
votes
1answer
66 views

How to implement transaction with php Toolkit

is it possible to implement transaction with php toolkit? I have to insert data into 2 objects. If there is any problem during the second insert, I would like to rollback the first insert.
1
vote
1answer
105 views

I need to pass along with the dollar amount AND the Confirmation # for a transaction to ET Tracking

Is it possible to attach a confirmation number from My Website once a person transacts to ExactTarget tracking so that I'm also able to see it in the feed that comes through with the dollar amounts? ...
11
votes
2answers
2k views

In Apex, what is the difference between the “execution context” and a transaction?

What are the boundaries of the execution context? What are the boundaries of a transaction?
4
votes
2answers
1k views

Multi-object create/update/delete? Use select SOAP APIs from REST client?

I have a client calling various SF REST APIs. So far so good. Unfortunately (and inexplicably in my opinion), object create, update, and delete operations can handle 1 object per REST API request, ...
1
vote
1answer
207 views

Field not writable after Database.rollback() and clone()

This is my custom save method: private void saveNewMode() { Savepoint toBeforeState = Database.setSavepoint(); try { insert parent; for(ChildA__c prs : childrenA) { ...
1
vote
2answers
147 views

Which custom save() is better?

Sometimes in code examples of custom save methods (of controller extensions) you see the use of try/catch and an explicit translation of Exception to PageMessage. Explicit Error Handling: public ...
5
votes
1answer
4k views

How to commit after Database.setSavePoint()

I have a batch Apex job that is currently wrapped in a single transaction, so that any exceptions will roll back the entire batch job. I'm fighting locking issues in SF, and as part of this, I'd ...
2
votes
1answer
440 views

Transaction rollback

I am hoping if you can help clarify the rollback on transactions, for scenario below. For example if we have the piece of code below MyCustomObject__c customObj = new MyCustomObject__c (); Savepoint ...