Jon August wrote:
I'm using Torque 3.2 and MySQL. I'm having no problems inserting data and selecting data, but when I try the following, it doesn't get saved to the database:if (OrderLine.lineExists(orderId, itemId)) { ol = OrderLine.getOrderLineById(orderId, itemId); ol.setQuantity(quantity); try { ol.save(); } catch (Exception ex) { } } I can throw a "System.out.println(ol.getQuantity())" after the setQuantity and it returns the updated quantity. The save just doesn't seem to stick.
Hmm... Try catch (Exception ex) { ex.printStackTrace(); } and see if an exception was thrown. :)
NB: Almost universally, an empty catch-block is a bad thing. I tend to use ex.printStackTrace() for notable but otherwise ignorable exceptions, and I throw new RuntimeException(ex) for unignorable exceptions that "should never happen." The only "exception" (pun intended) is an exception that's not particularly exceptional (e.g. when ObjectInputStream.readObject() throws EOFException -- which, as far as I know, is the only way to tell that ObjectInputStream is actually at EOF).
Shane --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
