Using Drupal 7.61 and Drupal Commerce 7.x-1.14 (+ Commerce Shipping 7.x-2.3 and Flat Rate 7.x-1.0-beta2)  My client has (probably) deleted the shipping line item for an order and he has tried to edit this order to add a new shipping line item (4 shipping services set by Flat rate).  We get the same AJAX error each time we try :   DatabaseTransactionOutOfOrderException: in DatabaseConnection-&gt;rollback()(line 1094 of /home/my_website/public_html/includes/database/database.inc).  Where should I look to fix this issue?  First there was also a Rules issue and I managed to fix it with a specific condition but we still can not edit the order to add a shipping line item.  EDIT : after a couple of new tries, it seems like the Rules Collect rate : flat rates fired and failed somewhere... some values are missing when adding a shipping line item through Order edit form, compared to Checkout where everything goes well   EDIT/ANSWER : Thanks to Clive's comments, I found a solution. Actually, multiple savepoints were involved in my process (one to save the new shipping line item in Drupal database and an another one to send it in an external database through a specific Rule). That makes sense when you read documentation on rollback(). So I have changed my Rule with a special condition related to shipping and now it works.
I am working on plugin to Drupal Commerce, and I started getting this error:   DatabaseTransactionOutOfOrderException: in DatabaseConnection-&gt;rollback() (line 1058 of /Library/WebServer/Documents/includes/database/database.inc).   Can anyone shed some light on what this error means? If I install a fresh drupal and reinstall my plugin, is that likely to clear things up?   Any advice?   Thanks!
Downcasting in Java Upcasting is allowed in Java, however downcasting gives a compile error.   The compile error can be removed by adding a cast but would anyway break at the runtime.   In this case why Java allows downcasting if it cannot be executed at the runtime? Is there any practical use for this concept?   public class demo {   public static void main(String a[]) {       B b = (B) new A(); // compiles with the cast,                           // but runtime exception - java.lang.ClassCastException   } }  class A {   public void draw() {     System.out.println("1");   }    public void draw1() {     System.out.println("2");   } }  class B extends A {   public void draw() {     System.out.println("3");   }   public void draw2() {     System.out.println("4");   } } If-else working, switch not How can I check if /bin/x86_64/bin/ls is a directory in a bash shell script  Here is what I tried:  #!/bin/bash  if [ $# -eq 2 ]; then     if [[ "$1" = /* ]]     then     cd ./bin/x86_64/bin/ls         if [ -d "$1" ]; then             echo "ok"             i="$1"             echo $i         else             echo "error2"             exit         fi     else         echo "error"         exit     fi fi When it's OK to omit "where?" How do I reference photographs with a separate numbering system to figures in latex? I am writing a book, and would like to be able to have the photographs labelled with an independent numbering system to my figures.  In the text I would refer to, for example, figure X and separately to photograph X, so I want them to have different numbering systems, just as equations and figures do.  Is it possible to have a different \begin{figure} environment so that the numbering can be separated? Disable auto-opening nautilus window after auto-mount Every time I plug a USB stick in, nautilus opens a new window with the contents of the drive. I would like to disable this auto-opening of the nautilus window, but I would like the actual auto-mount to keep working. Is this possible? As asked in the title? Does the independence of two random variables $X$ and $Y$ imply the independence of $X$ and $X+Y$? If so, what's the easiest way to prove that? How do you make a script or app to run or stop running automatically when the system is booted, a user logs on, at a specific time, when a disk is attached, etc.? I have command prompt in tcsh that shows the current working directory. The problem is that the command prompt becomes very big once I am in a deep hierarchy of folders. How do I set the command prompt to show, let's say, only the last 3 directory names? What is the closed formula for finding      $$ \sum_{i=0}^{k} \binom{n}{2i}=?\quad ,k\leq \lfloor{n/2}\rfloor $$   I need summation only up to some intermediate  $k$ where $k\leq \lfloor{n/2}\rfloor$ .  SAY I need a closed formula to calculate $\binom{8}{0}+ \binom{8}{2}+\binom{8}{4} +\binom{8}{6}$  HERE $n=8$ and $k=6$ Minimum of the Gamma Function $\Gamma (x)$ for $x>0$. How to find $x_{\min}$? Overriding !important style Title pretty much sums it up.  The external style sheet has the following code:  td.EvenRow a {   display: none !important; }   I have tried using:  element.style.display = "inline";   and  element.style.display = "inline !important";   but neither works. Is it possible to override an !important style using javascript.  This is for a greasemonkey extension, if that makes a difference. Stopping to eat is tedious, is there any way to automate the process? While I've managed to optimize and automate almost everything, constantly having to stop and eat is annoying (I run around a lot, so I get hungry quickly). Is there any device or tool that will keep me well fed at all times without having to stop and feed? Shell script zips a folder, but exclude parameters not working IF its run from cron.daily Packet sniffing in Python (Windows) What is the best way to sniff network packets using Python?  I've heard from several places that the best module for this is a module called Scapy, unfortunately, it makes python.exe crash on my system. I would assume that it's just a problem with how I installed it, except that many other people have told me that it doesn't work particularly well on Windows. (If anyone is interested, I'm running Windows Vista, which might affect things).  Does anyone know of a better solution?  UPD:  After reading the answer telling me to install PyPcap, I messed around with it a bit and found out that Scapy, which I had tried using, was telling me to install PyPcap as well, except that it's a modified version for it's use. It was this modified PyPcap that was causing the problem, apparently, since the example in the answer also caused a hang.  I installed the original version of PyPcap (from Google's site), and Scapy started working fine (I didn't try many things, but at least it didn't crash as soon as I started sniffing). I sent a new defect ticket to the Scapy developers: , hope they can do something with it.  Anyways, just thought I'd let y'all know. Difficult Polynomial Question What is Quantization? Show that $y_1$ and $y_2$ are not Linearly Independent Suppose that $y_1(x)$ and $y_2(x)$ are solutions of the differential equation $y''+py'+qy=0$ on $I$. How can I show that if $y_1$ and $y_2$ vanish at the same point then they are not linearly independent?   Here is my attempt to prove the problem. Since $y_1(x)$ and $y_2(x)$ are solutions of the differential equation $y''+py'+qy=0$ on $I$, it is enough for me to show that the Wronskian of $y_1$ and $y_2$ denoted by $W(y_1,y_2)$ is zero. Now since $y_1$ and $y_2$ vanish at the same point say $p$ we have $y_1(p)=0$ and also $y_2(p)=0$.   Solving for $W(y_1,y_2)(p)$ we have: $y_1(p)y_2'(p)-y_2(p)y_1'(p)=0$ since $y_1(p)=0$ and also $y_2(p)=0$.   Am I correct? Thanks The "Reputation &amp; Moderation" page on any site (/help/site-moderators) still refers to the company behind Stack Exchange as Stack Exchange and not Stack Overflow.     Moderators act as a liaison between the community and Stack Exchange the company.   Seeing as how the name change was recent, I'm not surprised this hasn't been caught yet, and I'm sure there are other instances of this around somewhere. Someone asked a very similar question in regards to window recovery for windows xp:   I'm using windows 8 (or 8.1 now). I run Dual Monitors. On Monitor 2 I sometimes have the input switched to something else other than the windows display (Mac or PS3). If there was a program that was displaying on Window #2 that does not have 'move' where I could potentially alt-space-m arrow keys. Is there another way to get that program to display on Window #1?  I tried right click on the program and doesn't seem to be anything there. I tried Windows Key and Arrows. I Tried right click toolbar and cascade.  I'm hoping this is a DUP or Softball question because this annoys the crap out of me.  Thanks!!