Direct sql query in magento not working Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Upgrade from 1.9.1 to 1.9.2 ErrorSite went down after last designer cleared cacheMYSQL ERROR [1045] Acces denied for user 'username'@'localhost' (using password: YES)Magento order data not getting using observer event from adminMagento cant make an orderThere has been an error processing your request magento 1.9.0.1SQLSTATE[HY000] : General error: 2013 Lost connection to MySQL server during query in MagentoMagento installation on live server is throwing errorSome transactions have not been committed or rolled backMagento 1.9 - There has been an error processing your request
Random body shuffle every night—can we still function?
Is there more forest in the Northern Hemisphere now than 100 years ago?
AppleTVs create a chatty alternate WiFi network
Is it dangerous to install hacking tools on my private linux machine?
What to do with repeated rejections for phd position
How many time has Arya actually used Needle?
How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?
Asymptotics question
Cut your dress down to your length/size
How does the math work when buying airline miles?
Connecting Mac Book Pro 2017 to 2 Projectors via USB C
What is the difference between CTSS and ITS?
What does Turing mean by this statement?
Drawing a ribbon graph
Google .dev domain strangely redirects to https
New Order #6: Easter Egg
What would you call this weird metallic apparatus that allows you to lift people?
Does the Mueller report show a conspiracy between Russia and the Trump Campaign?
How does light 'choose' between wave and particle behaviour?
How were pictures turned from film to a big picture in a picture frame before digital scanning?
Why are vacuum tubes still used in amateur radios?
How could we fake a moon landing now?
Why does electrolysis of aqueous concentrated sodium bromide produce bromine at the anode?
Why weren't discrete x86 CPUs ever used in game hardware?
Direct sql query in magento not working
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Upgrade from 1.9.1 to 1.9.2 ErrorSite went down after last designer cleared cacheMYSQL ERROR [1045] Acces denied for user 'username'@'localhost' (using password: YES)Magento order data not getting using observer event from adminMagento cant make an orderThere has been an error processing your request magento 1.9.0.1SQLSTATE[HY000] : General error: 2013 Lost connection to MySQL server during query in MagentoMagento installation on live server is throwing errorSome transactions have not been committed or rolled backMagento 1.9 - There has been an error processing your request
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am facing strange problem, when I use direct SQL query method in Magento controller its not working
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error
User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937
Please advise me
magento-1.9 database
bumped to the homepage by Community♦ 15 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am facing strange problem, when I use direct SQL query method in Magento controller its not working
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error
User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937
Please advise me
magento-1.9 database
bumped to the homepage by Community♦ 15 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11
add a comment |
I am facing strange problem, when I use direct SQL query method in Magento controller its not working
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error
User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937
Please advise me
magento-1.9 database
I am facing strange problem, when I use direct SQL query method in Magento controller its not working
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error
User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937
Please advise me
magento-1.9 database
magento-1.9 database
edited Jul 4 '16 at 17:46
Rinto George
asked Jul 4 '16 at 8:37
Rinto GeorgeRinto George
195213
195213
bumped to the homepage by Community♦ 15 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 15 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11
add a comment |
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11
add a comment |
4 Answers
4
active
oldest
votes
You do not need to use Mage API to get the table name.
Try this please:
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);Let me know if this worked!
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
add a comment |
Try to begin transaction and then commit it.
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
try
$connection->beginTransaction();
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
$connection->commit();
catch (Exception $e)
$connection->rollBack();
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statementtry $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:35
add a comment |
Try to Make an log like below...
Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');
add a comment |
There is no issue with your block of code.
I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.
The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.
Cheers!
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124071%2fdirect-sql-query-in-magento-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You do not need to use Mage API to get the table name.
Try this please:
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);Let me know if this worked!
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
add a comment |
You do not need to use Mage API to get the table name.
Try this please:
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);Let me know if this worked!
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
add a comment |
You do not need to use Mage API to get the table name.
Try this please:
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);Let me know if this worked!
You do not need to use Mage API to get the table name.
Try this please:
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);Let me know if this worked!
answered Jul 4 '16 at 9:01
PaulPaul
23817
23817
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
add a comment |
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
1
1
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question
– Robbie Averill
Jul 4 '16 at 9:02
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
@RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?
– Paul
Jul 4 '16 at 9:06
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
Even if I used direct table name it's not changing anything at all.
– Rinto George
Jul 4 '16 at 9:08
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
@duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?
– Paul
Jul 4 '16 at 9:10
add a comment |
Try to begin transaction and then commit it.
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
try
$connection->beginTransaction();
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
$connection->commit();
catch (Exception $e)
$connection->rollBack();
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statementtry $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:35
add a comment |
Try to begin transaction and then commit it.
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
try
$connection->beginTransaction();
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
$connection->commit();
catch (Exception $e)
$connection->rollBack();
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statementtry $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:35
add a comment |
Try to begin transaction and then commit it.
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
try
$connection->beginTransaction();
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
$connection->commit();
catch (Exception $e)
$connection->rollBack();
Try to begin transaction and then commit it.
$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');
try
$connection->beginTransaction();
$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);
$connection->commit();
catch (Exception $e)
$connection->rollBack();
answered Jul 4 '16 at 19:02
Neklo.comNeklo.com
2,2991618
2,2991618
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statementtry $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:35
add a comment |
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statementtry $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);
– Neklo.com
Jul 5 '16 at 11:35
Still same result
– Rinto George
Jul 5 '16 at 4:47
Still same result
– Rinto George
Jul 5 '16 at 4:47
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
I am not sure whats blocking me from committing.
– Rinto George
Jul 5 '16 at 5:58
Please add exception logging
...}catch (Exception $e) $connection->rollBack(); Mage::logException($e); – Neklo.com
Jul 5 '16 at 11:18
Please add exception logging
...}catch (Exception $e) $connection->rollBack(); Mage::logException($e); – Neklo.com
Jul 5 '16 at 11:18
Or try to use the Zend_Db 'insert' statement
try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e); – Neklo.com
Jul 5 '16 at 11:35
Or try to use the Zend_Db 'insert' statement
try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e); – Neklo.com
Jul 5 '16 at 11:35
add a comment |
Try to Make an log like below...
Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');
add a comment |
Try to Make an log like below...
Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');
add a comment |
Try to Make an log like below...
Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');
Try to Make an log like below...
Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');
answered Jun 13 '18 at 12:13
MR.R DNATHMR.R DNATH
31617
31617
add a comment |
add a comment |
There is no issue with your block of code.
I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.
The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.
Cheers!
add a comment |
There is no issue with your block of code.
I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.
The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.
Cheers!
add a comment |
There is no issue with your block of code.
I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.
The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.
Cheers!
There is no issue with your block of code.
I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.
The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.
Cheers!
answered Sep 26 '18 at 14:23
Martin J.Martin J.
133
133
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124071%2fdirect-sql-query-in-magento-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem
– simonthesorcerer
Sep 22 '17 at 21:11