Why am I not getting my child’s app requests Apple?

Why am I not getting my child’s app requests Apple?

Why am I not getting my child’s app requests Apple?

On your iPhone, iPad, or iPod touch Go to Settings. Tap your name, then tap Family Sharing. If youre the family organizer, make sure that Purchase Sharing is turned on. Then you can tap a family members name to see if Ask to Buy is turned on for their account.

How do I approve purchases on Family Sharing Apple?

On your iPhone, iPad, or iPod touch

  • Open the Settings app.
  • Tap your name.
  • Tap Family Sharing.
  • Tap Ask to Buy.
  • Tap your family members name.
  • Use the toggle to turn on or turn off Ask to Buy.

How do I change permissions on Family Sharing?

  • Open the Family Link app .
  • Select your child.
  • On the Device card, tap Settings.
  • Tap a permission.
  • Below your childs device, switch the permission on or off.

Where do I find my childs app requests?

Family Link app

  • On your device, open the Family Link app .
  • At the top left, tap Menu. Approval requests.

Where do Apple family requests go?

If the family organizer approves the request and completes the purchase, the item automatically downloads to the childs device. If the family organizer declines the request, no purchase or download will take place.

Why am I not getting ask to buy notifications on my iPhone?

If you miss an Ask to Buy notification, you can find the request in Notification Centre on your iPhone, iPad, iPod touch or Mac. If you still cant see your Ask to Buy requests, check which Apple ID youve signed in with, check your Family Sharing settings and make sure youre on a supported device.

Why is Apple Family Sharing not working?

Check your Family Sharing settings. Make sure that youre using the same Apple ID for Family Sharing and Media Purchases. And make sure that purchase sharing is turned on. Then ask your family members to check their settings too.

How do I approve purchases in Family Sharing?

Approve or deny requests

  • When a family member makes a purchase, theyll see a screen that asks for your password.
  • Review the request.
  • To approve it, enter your Google Account password on their device.
  • Tap Approve.

Where do Family Sharing app requests go?

On your iPhone, iPad, or iPod touch Go to Settings. Tap your name, then tap Family Sharing. If youre the family organizer, make sure that Purchase Sharing is turned on. Then you can tap a family members name to see if Ask to Buy is turned on for their account.

How do I change Family Sharing settings?

Step 2: Share with your family

  • On your Android phone or tablet, open the Google One app .
  • At the top, tap Menu. Settings.
  • Tap Manage family settings.
  • Turn on Share Google One with your family. To confirm, on the next screen, tap Share.
  • Tap Manage family group.
  • Follow the instructions to finish setup.

How do I change family permissions on my iPhone?

On your iPhone, iPad, or iPod touch

  • Go to Settings.
  • Tap your name.
  • Tap Family Sharing, then tap your family members name.
  • Tap Role.
  • Tap Parent/Guardian.

Where do I go to approve my child’s app request?

Ask in a message

  • Youll get a notification on your phone.
  • Review the request. To see more details, tap the request or the name of the app.
  • Tap Approve or Deny.

How do I turn off app permissions in Family Sharing?

Family Link app

  • Open the Family Link app .
  • Select your child.
  • On the App activity, card tap More.
  • Tap the name of the app you want to allow or block.
  • Turn Allow app on or off.

Where do I find app requests from my child?

Play Store app

  • On your Android device, open the Play Store app .
  • At the top right, tap your Profile picture or initial Settings. Family.
  • Tap Manage approval requests.

Where do I find app requests from my child on iPhone?

If you miss an Ask to Buy notification, you can find the request in Notification Center on your iPhone, iPad, iPod touch, Apple Watch, or Mac.

Why am I not getting my child’s app requests on iPhone?

On your iPhone, iPad or iPod touch Go to Settings. Tap your name, then tap Family Sharing. If youre the family organiser, make sure that Purchase Sharing is turned on. Then you can tap a family members name to see if Ask to Buy is turned on for their account.

How do I find my family requests?

With Ask to Buy and Family Sharing, whenever a child initiates a new purchase or free download, a request goes to the family organizer. The organizer can review the item and approve the purchase or decline the request right from their own iPhone, iPad, or iPod touch.

Where do I find ask to buy requests on iPhone?

Family Link app

  • On your device, open the Family Link app .
  • At the top left, tap Menu. Approval requests.

How do I turn on Ask to buy notifications?

On your iPhone, iPad, or iPod touch

  • Open the Settings app.
  • Tap your name.
  • Tap Family Sharing.
  • Tap Ask to Buy.
  • Tap your family members name.
  • Use the toggle to turn on or turn off Ask to Buy.

Where do I find app purchase requests?

Note: to work properly, each of your children must be logged into their devices under their individual Apple ID.

  • Tap Your Profile, select Family Sharing, and tap your childs name.
  • Toggle on Ask to Buy.

How do I fix my Family Sharing?

Common Fixes for the Apple Music Family Sharing Not Working Issue

  • Verify Apple ID on an iOS device.
  • Verify Apple ID on a Mac.
  • Ensure Apple Music sharing is turned on.
  • Log out of your account on an iOS device.
  • Log out of your account in iTunes on Mac.
  • Remove your family members from your account.

How do I activate Family Sharing?

You can set up a Family Library by opening the Google Play Store app and by tapping on menu followed by Account  Family  Sign Up for Family Library. Everyone in your family group must be at least 13 years old and must live together in the same country as you.

How do I get Family Sharing to work on my iPhone?

On your iPhone, iPad, or iPod touch

  • Go to Settings.
  • Tap your name.
  • Tap Family Sharing, then tap Set Up Your Family.
  • Follow the onscreen instructions to set up your family and invite your family members.

Why is my apple family invite not working?

Tap Cancel All Pending Invites. After youve done this, make sure all your devices have updated software, and have the family member youve invited update their iOS or iPadOS, as well. Restart each device on both ends of the invitation. Now, try inviting the person again; it should work this time.

How do I approve approval for app purchases?

On your iPhone, iPad, or iPod touch

  • Open the Settings app.
  • Tap your name.
  • Tap Family Sharing.
  • Tap Ask to Buy.
  • Tap your family members name.
  • Use the toggle to turn on or turn off Ask to Buy.

Related posts on Apple  :

Qt Creator color scheme

Qt Creator color scheme

Qt Creator color scheme

I found some trick for your problem!
Here you can see it: Habrahabr — Redesigning Qt Creator by your hands (russian lang.)

According to that article, that trick is kind of not so dirty, but hack (probably it wouldnt harm your system, but it can leave some artifacts on your interface).

You dont need to patch something (there is possibility, but I dont recommend).

Main idea is to use stylesheet like this stylesheet.css:

// on Linux
qtcreator -stylesheet=.qt-stylesheet.css 
// on Windows
[pathToQt]QtCreatorbinqtcreator.exe -stylesheet [pathToStyleSheet]

To get such effect:
QtCreator

To customize by your needs, you may need to read documentation: Qt Style Sheets Reference, Qt Style Sheets Examples and so on.

This wiki page is dedicated to custom Qt Creator styling.

P.S. If youll got better stylesheet, share it, Ill be happy! 🙂


UPD (10.12.2014): Hopefully, now we can close this topic. Thanks, Simon G., Things have changed once again. Users may use custom themes since QtCreator 3.3. So hacky stylesheets are no longer needed.

Everyone can take a look at todays update: Qt 5.4 released. There you can find information that Qt 5.4, also comes with a brand new version of Qt Creator 3.3. Just take a look at official video at Youtube.

So, to apply dark theme you need go to Tools -> Options -> Environment -> General tab, and there you need to change Theme.

See more information about its configuring here: Configuring Qt Creator.

Simple in two line

  1. Go to Tools -> Options -> Environment -> General tab,
  2. Change Theme to dark

Qt Creator color scheme

In newer versions of Qt Creator (Currently using 4.4.1), you can follow these simple steps:

Tools > Options > Environment > Interface

Here you can change the theme to Flat Dark.

It will change the whole Qt Creator theme, not just the editor window.

enter

Related posts on color scheme  :

python – Verify host key with pysftp

python – Verify host key with pysftp

python – Verify host key with pysftp

The pysftp has some bugs regarding host key handling, as described below. It also seems that the pysftp project was abandoned. Consider using Paramiko directly instead. The pysftp is just a wrapper on top of Paramiko and it does not add anything really significant. See pysftp vs. Paramiko.

For handling of host keys in Paramiko, see:
Paramiko Unknown Server


If you want to keep using pysftp, do not set cnopts.hostkeys = None (as the second most upvoted answer shows), unless you do not care about security. You lose a protection against Man-in-the-middle attacks by doing so.

Use CnOpts.hostkeys (returns HostKeys) to manage trusted host keys.

cnopts = pysftp.CnOpts(knownhosts=known_hosts)

with pysftp.Connection(host, username, password, cnopts=cnopts) as sftp:

where the known_hosts contains a server public key(s)] in a format like:

example.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB...

If you do not want to use an external file, you can also use

from base64 import decodebytes
# ...

keydata = bAAAAB3NzaC1yc2EAAAADAQAB...
key = paramiko.RSAKey(data=decodebytes(keydata))
cnopts = pysftp.CnOpts()
cnopts.hostkeys.add(example.com, ssh-rsa, key)

with pysftp.Connection(host, username, password, cnopts=cnopts) as sftp:

Though as of pysftp 0.2.9, this approach will issue a warning, what seems like a bug:
Failed to load HostKeys warning while connecting to SFTP server with pysftp


An easy way to retrieve the host key in the needed format is using OpenSSH ssh-keyscan:

$ ssh-keyscan example.com
# example.com SSH-2.0-OpenSSH_5.3
example.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB...

(due to a bug in pysftp, this does not work, if the server uses non-standard port – the entry starts with [example.com]:port + beware of redirecting ssh-keyscan to a file in PowerShell)

You can also make the application do the same automatically:
Use Paramiko AutoAddPolicy with pysftp
(It will automatically add host keys of new hosts to known_hosts, but for known host keys, it will not accept a changed key)


Though for an absolute security, you should not retrieve the host key remotely, as you cannot be sure, if you are not being attacked already.

See my article Where do I get SSH host key fingerprint to authorize the server?
Its for my WinSCP SFTP client, but most information there is valid in general.


If you need to verify the host key using its fingerprint only, see Python – pysftp / paramiko – Verify host key using its fingerprint.

One option is to disable the host key requirement:

import pysftp
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None   
with pysftp.Connection(host, username, password, cnopts=cnopts) as sftp:
    sftp.put(local_path, remote_path)

You can find more info about that here:
https://stackoverflow.com/a/38355117/1060738

Important note:

By setting cnopts.hostkeys=None youll lose the protection against Man-in-the-middle attacks by doing so. Use @martin-prikryl answer to avoid that.

python – Verify host key with pysftp

Try to use the 0.2.8 version of pysftp library.

$ pip uninstall pysftp && pip install pysftp==0.2.8

And try with this:

try:
    ftp = pysftp.Connection(host, username=user, password=password)
 except:
    print(Couldnt connect to ftp)
    return False

Why this?
Basically is a bug with the 0.2.9 of pysftp
here all details
https://github.com/Yenthe666/auto_backup/issues/47

Related posts on python  :

javascript – event bus in React?

javascript – event bus in React?

javascript – event bus in React?

Event Bus is only a Global Function Register, can you use it

class _EventBus {

    constructor() {
        this.bus = {};
    }

    $off(id) {
       delete this.bus[id];
    }

    $on(id, callback) {
        this.bus[id] = callback;
    }

    $emit(id, ...params) {
        if(this.bus[id])
            this.bus[id](...params);
    }
}

export const EventBus = new _EventBus();

The export const prevent multiple instances, making the class static

A parent component can manage the state and methods consumed by child components when passed down through props.

The following example increments a count. SibOne displays the count and a button in SibTwo increments the count.

class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            count: 0
        };
    }
    incrementCount = () => {
        this.setState({
            count: this.state.count + 1
        });
    }
    render() {
        return (
            <div className=App>
                <SibOne count={this.state.count}/>
                <SibTwo incrementCount={this.incrementCount}/>
            </div>
        );
    }
}

const SibOne = props => <div>Count: {props.count}</div>;

const SibTwo = props => (
    <button onClick={props.incrementCount}>
        Increment Count
    </button>
);

Demo: https://codesandbox.io/s/zqp9wj2n63

More on Components and Props: https://reactjs.org/docs/components-and-props.html

javascript – event bus in React?

In the case of two sibling components, you would hold the state in the parent component and pass that state as a prop to both siblings:

class ParentComponent extends Component {
  state = {
   specialProp: bar
  }

  changeProp = () => {
   // this.setState.. 
  }
  render() {
    return (
      <div>
        <FirstSibling specialProp={this.state.specialProp} />
        <SecondSibling changeProp={this.changeProp} specialProp={this.state.specialProp} />
      </div>
    );
  }
}

Related posts on java script   :

reactjs – How to use different .env files with nextjs?

reactjs – How to use different .env files with nextjs?

reactjs – How to use different .env files with nextjs?

Next 9.4 has built-in support for .env files: https://nextjs.org/docs/basic-features/environment-variables

But, in case you want to have multiple .env files, like:

  • .env.development
  • .env.staging
  • .env.prestaging
  • .env.production

It would be impossible to do with a built-in env variables support. Theres only 3 environments that officially supported for now, its: development, test, production. With next dev you use development, next build && next start uses production environment.

If you need to build for production environment, but using .env.staging for example, then you need to add env-cmd package, and add this line to your package.json:

build:staging: env-cmd -f .env.staging yarn build && yarn start

Next would make a production build with .env.staging variables.

The issue with most of these answers is they go against the principal of build once run everywhere, in reality most of us are using this technique build and run with Docker containers. Its not possible to have multiple build commands like this, and it would be bad practice.

Better have your environment available at runtime. We created a package that allows next static optimisation and still have runtime env vars via window.__ENV

https://github.com/andrewmclagan/react-env

This works by generating an environment config object at runtime from whitelisted env vars:

{
  ...
  scripts: {
    dev: react-env -- next dev, // where .env.${APP_ENV}
    start: react-env --env APP_ENV -- next start // where .env.${APP_ENV}
  }
  ...
}

reactjs – How to use different .env files with nextjs?

You can have different .env files in nextjs with following two ways:

1. Using env-cmd package

Provide the path to your environment file in the scripts like:

scripts: {
    start: env-cmd path/to/prod/env/file next start,
    start:dev: env-cmd path/to/prod/env/file next dev,   
    build:dev: env-cmd path/to/dev/env/file next build,
    build:test: env-cmd path/to/test/env/file next build,
    build:stage: env-cmd path/to/stage/env/file next build,
    build: env-cmd path/to/stage/prod/file next build,        
},

2. Using dotenv package

In your next.config.js file add following:

require(dotenv).config({ path: `${process.env.ENVIRONMENT}` });

module.exports = {
      // your configs
}

and in your scripts, provide that ENVIRONMENT variable like:

scripts: {
    start: ENVIRONMENT=path/to/prod/env/file next start,
    start:dev: ENVIRONMENT=path/to/dev/env/file next dev,
    build:dev: ENVIRONMENT=path/to/dev/env/file next build,
    build:test: ENVIRONMENT=path/to/test/env/file next build,
    build:stage: ENVIRONMENT=path/to/stage/env/file next build,
    build: ENVIRONMENT=path/to/stage/prod/file next build,        
},

NOTE: The thing is do not to put your .env* files in the root folder, otherwise NEXT will auto-pick from your .evn* files and it only supports production and development stages. So itll ignore other .env.my-stage files.

Related posts on Reactjs  :

swift – Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed

swift – Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed

swift – Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed

I faced the same error in a different context, in XCode 12.0.1 too. It might not be related, but I suspect its an issue with accessing the run loop of the main thread. I was just trying out some introductory code I found online, and faced the same issue, so this is a bug, rather than a problem with your code. Heres how you can get a piece of code that has the same issue:

git clone [email protected]:BestKora/CS193P-Fall-2017-Demo-iOS12.git
cd CS193P-Fall-2017-Demo-iOS12/Cassini L10
xed . # this opens XCode (CLI tool stands for XCode editor)

Having said that, by rewriting the code, I was able to prevent this issue. Maybe you can find something amongst the code below to fix your specific issue:

Specifically, instead of using the following (DispatchQueue.global)

    private func fetchImage() {
        if let url = imageURL {
            spinner.startAnimating()
            DispatchQueue.global(qos: .userInitiated).async { [weak self] in
                let urlContents = try? Data(contentsOf: url)
                DispatchQueue.main.async {
                    if let imageData = urlContents, url == self?.imageURL {
                        self?.image = UIImage(data: imageData)
                    }
                }
            }
        }
    }

I use URLSession.shared.dataTask, and this error no longer happens:

    private func fetchImage() {
        print(fetching image)
        if let url = imageURL {
            
            let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
                guard let data = data else {
                    return
                }
                // maybe try dispatch to main
                DispatchQueue.main.async {
                    self.imageView.image = UIImage(data: data)
                }
            }
            task.resume()
        }
    }

I had same issue in an Widget Target, but solved it by adding public to the variables.

Fixed struct is shown below.

struct LastCommitEntry: TimelineEntry {
    public let date: Date
    public let commit: Commit
}

swift – Strange error nw_protocol_get_quic_image_block_invoke dlopen libquic failed

Restarting my simulator did the trick.

Related posts on swift  :

spring mvc – How to generate swagger.json

spring mvc – How to generate swagger.json

spring mvc – How to generate swagger.json

You can get the url with your swagger-ui html page:

enter

GET http://localhost:8080/v2/api-docs?group=App

And actually you can get all the urls with chrome/firefox develop tools network feature.

If you use Maven, you can generate client and server side documentation (yaml, json and html) by using swagger-maven-plugin

Add this to your pom.xml:

.....
 <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <springmvc>true</springmvc>
                            <locations>com.yourcontrollers.package.v1</locations>
                            <schemes>http,https</schemes>
                            <host>localhost:8080</host>
                            <basePath>/api-doc</basePath>
                            <info>
                                <title>Your API name</title>
                                <version>v1</version>
                                <description> description of your API</description>
                                <termsOfService>
                                    http://www.yourterms.com
                                </termsOfService>
                                <contact>
                                    <email>[email protected]</email>
                                    <name>Your Name</name>
                                    <url>http://www.contact-url.com</url>
                                </contact>
                                <license>
                                    <url>http://www.licence-url.com</url>
                                    <name>Commercial</name>
                                </license>
                            </info>
                            <!-- Support classpath or file absolute path here.
                            1) classpath e.g: classpath:/markdown.hbs, classpath:/templates/hello.html
                            2) file e.g: ${basedir}/src/main/resources/markdown.hbs,
                                ${basedir}/src/main/resources/template/hello.html -->
                            <templatePath>${basedir}/templates/strapdown.html.hbs</templatePath>
                            <outputPath>${basedir}/generated/document.html</outputPath>
                            <swaggerDirectory>generated/swagger-ui</swaggerDirectory>
                            <securityDefinitions>
                                <securityDefinition>
                                    <name>basicAuth</name>
                                    <type>basic</type>
                                </securityDefinition>
                            </securityDefinitions>
                        </apiSource>
                    </apiSources>
                </configuration>
            </plugin> ........

You can download *.hbs template at this address:
https://github.com/kongchen/swagger-maven-example

Execute mvn swagger:generate
JSon documentation will be generated at your project /generated/swagger/ directory.
Past it on this address :
http://editor.swagger.io

And generate what ever you want ( Server side or Client side API in your preferred technology )

spring mvc – How to generate swagger.json

I have done this with a small trick

I have added the following code in the end of my home controller test case

import org.springframework.boot.test.web.client.TestRestTemplate;

public class HomeControllerTest extends .... ...... {

@Autowired
private TestRestTemplate restTemplate;


@Test
public void testHome() throws Exception {
     //.......
     //... my home controller test code 
     //.....

    String swagger = this.restTemplate.getForObject(/v2/api-docs, String.class);

    this.writeFile(spec.json, swagger );
}

public void writeFile(String fileName, String content) {

    File theDir = new File(swagger);

    if (!theDir.exists()) {
        try{
            theDir.mkdir();
        } 
        catch(SecurityException se){ }        
    }

    BufferedWriter bw = null;
    FileWriter fw = null;
    try {
        fw = new FileWriter(swagger/+fileName);
        bw = new BufferedWriter(fw);
        bw.write(content);
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        try {
            if (bw != null)
                bw.close();
            if (fw != null)
                fw.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }

    }

}
}

I dont know this is right way or not But it is working 🙂

Dependency

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.4.0</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.6.1</version>
    </dependency> 

Related posts on spring mvc   :

r – Error in gzfile(file, wb): cannot open the connection or compressed file

r – Error in gzfile(file, wb): cannot open the connection or compressed file

r – Error in gzfile(file, wb): cannot open the connection or compressed file

This is a bit late but for anyone coming here for help, I got this error when I was trying to write a file from RStudio and my destination file path was very long. I realized this could be a problem because when I wrote the file to another location with a shorter name and tried to copy it into my original destination, Windows gave me an error saying File path too long. You might need to save the original file into another location with a shorter absolute path.

Maybe you should look here. At the end it says

n

n

Note:n The most common reason for failure is lack of write permission in the current directory. For save.image and for saving at the end of a session this will shown by messages like

n

n

Error in gzfile(file, wb) : unable to open connectionnIn addition: Warning message:nIn gzfile(file, wb) :n  cannot open compressed file .RDataTmp,n  probable reason Permission deniedn

n

So rapidly, if you try getwd(), look at where is your working directory set. If youre trying to save your document in a place where its not in your current working directory, it will throw you this error.

n

At the end of your error message, it says probable reason No such file or directorynGraphics error: Error in gzfile(file, wb) : cannot open the connectionnnMy diagnosis would be simply that its trying to save your item in the wrong place and RStudio is not able to find the right place.

r – Error in gzfile(file, wb): cannot open the connection or compressed file

This burned me so hopefully saves someone else some toil. The issue was that the classifiers loaded just fine on OS X but on the Linux deployment system they would fail with the error listed in the question. The issue was the the files on the disk had extension abc.RData but the code modelAbc <- readRDS(file=abc.Rdata). The difference in the upper and lowercase D in the .RData vs .Rdata extension would fail on Linux. It was not very noticeable but check your extensions for case.

Related posts on R Error :

javascript – Failed to load resource: the server responded with a status of 404 (Not Found)

javascript – Failed to load resource: the server responded with a status of 404 (Not Found)

javascript – Failed to load resource: the server responded with a status of 404 (Not Found)

Your files are not under the jsp folder thats why it is not found.
You have to go back again 1 folder
Try this:

<script src=../../Jquery/prettify.js></script>

Note the failing URL:

Failed ... http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.css

Now examine one of your links:

<link href=../Jquery/jquery.multiselect.css rel=stylesheet/>

The ../ is shorthand for The containing directory, or Up one directory. This is a relative URL. At a guess, you have a file in /jsp/<somefolder>/ which contains the <link /> and <style /> elements.

I recommend using an absolute URL:

<link href=/RetailSmart/Jquery/jquery.multiselect.css rel=stylesheet/>

The reason for using an absolute url is that Im guessing the links are contained in some common file. If you attempt to correct your relative pathing by adding a second ../, you may break any files contained in /jsp.

javascript – Failed to load resource: the server responded with a status of 404 (Not Found)

If you have resource with woff extension and getting error then add following code in your web.config application will help to fix.

<system.webServer>
<staticContent>
   <mimeMap fileExtension=.woff mimeType=application/x-font-woff />
</staticContent>
</system.webServer>

For Resources like JavaScript or CSS not found then provide the path of adding link or script in following way

<link ref=@(Url.Content(path of css)) rel=stylesheet>

<script src=@(Url.Content(path of js)) type=text/javascript></script>

Related posts on java script   :

sql server – When its necessary to check @@trancount > 0 in try catch block?

sql server – When its necessary to check @@trancount > 0 in try catch block?

sql server – When its necessary to check @@trancount > 0 in try catch block?

I can think of a few scenarios to consider when dealing with @@trancount:

  1. The current transaction was called from another stored procedure which had
    its own transaction
  2. The current transaction was called by some .NET code with its own
    transaction
  3. The current transaction is the only transaction

I believe Remus Rusanus Exception handling and nested transactions handles all these possibilities.

when u dont use @@trancount, the error message of nested transaction stored procedure does not return the exact cause of error just reurtn The rollback transaction request has no corresponding begin transaction,otherwise it gives exact cause of error, so its easy to handle the error with proper syntax.

sql server – When its necessary to check @@trancount > 0 in try catch block?

To answer the question – the time to do a @@trancount is if the code in the middle could potentially have already performed the commit or rollback of the transaction you started. So if you are calling stored procedures for example – then perform the checks at the end.

Incidentally rather than doing an if @@trancount>0 I would suggest it is better to check the @@trancount at the start of your block of code, and then see if the count has gone up by the end, in which case do the commit or rollback, depending on try/catch.

Particularly if you are in a trigger, because the @@trancount will always be 1 there, so just doing a @@trancount>0 could cause an error.

But even if your code is just in a stored procedure, supposed it was called by another procedure that itself has an open transaction, if your code errors and rolls back, then the outer stored procedure will have its transaction rolled back also (see https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/).

So

BEGIN TRAN
PRINT @@TRANCOUNT

BEGIN TRAN
PRINT @@TRANCOUNT

ROLLBACK TRAN
PRINT @@TRANCOUNT

shows
1
2
0

So basically – if the code in the middle is calling other procedures, you need to perform the IF @@TRANCOUNT check.

Related posts on SQL Server  :