Hello Nicolas, thank you very much for your help.
I tried it:Debug.logVerbose("### Store List Prices ("+productPrices.size()+") ###", MODULE);
Transaction transaction = null;
transaction = TransactionUtil.suspend();
boolean transactionBegan = TransactionUtil.begin();
delegator.storeAll(productPrices);
TransactionUtil.commit(transactionBegan);
TransactionUtil.resume(transaction);
TransactionUtil.commit();
Debug.logVerbose("### List Prices Stored
("+productPrices.size()+") ###", MODULE);
but the output is still the same:[java] 2014-07-15 09:58:54,831 (default-invoker-Thread-6) [ OfbizPriceImporter.java:688:DEBUG] ### Store List Prices (1234) ### [java] 2014-07-15 09:58:54,831 (default-invoker-Thread-6) [ TransactionUtil.java:348:WARN ] No transaction in place, so not suspending. [java] 2014-07-15 09:58:55,990 (default-invoker-Thread-6) [ TransactionUtil.java:210:WARN ] [TransactionUtil.commit] Not committing transaction, status is No Transaction (6) [java] 2014-07-15 09:58:55,990 (default-invoker-Thread-6) [ OfbizPriceImporter.java:696:DEBUG] ### List Prices Stored (1234) ###
Kind regards Marc Am 10.07.2014 15:12, schrieb Nicolas Malin:
Ok I understand.If you run a commit in your code at the service end, the transaction has been already commitedSo, open a new transaction like this : Transaction transaction = null; try { transaction = TransactionUtil.suspend(); boolean transactionBegan = TransactionUtil.begin(); delegator.storeAll(listOfGenericValues); TransactionUtil.commit(transactionBegan ); TransactionUtil.resume(transaction); } catch (YourExceptionLevel e) { Debug.logError(e, module); TransactionUtil.rollback(); TransactionUtil.resume(transaction); } Le 10/07/2014 14:59, Marc von der Brüggen a écrit :Hi Nicolas,I didn't set use-transaction="false", so that the service can handle the transactions by itself.Before I tried delegator.storeAll(listOfGenericValues); TransactionUtil.commit(); it looked like this: boolean transactionBegan = TransactionUtil.begin(); delegator.storeAll(listOfGenericValues); TransactionUtil.commit(transactionBegan ); However, transactionBegan was always false. Kind regards Marc Am 10.07.2014 11:59, schrieb Nicolas Malin:Do you open a transaction before ? TransactionUtil.begin(); delegator.storeAll(listOfGenericValues); TransactionUtil.commit(); Nicolas Le 10/07/2014 11:18, Marc von der Brüggen a écrit :Hello, does delegator.storeAll(listOfGenericValues) always perform a commit? I want to make sure the data is committed, but if I do the following: delegator.storeAll(listOfGenericValues); TransactionUtil.commit(); I receive a warning:[java] 2014-07-10 10:20:55,841 (default-invoker-Thread-6) [ TransactionUtil.java:210:WARN ] [TransactionUtil.commit] Not committing transaction, status is No Transaction (6)Thank you very much! Kind regards Marc
-- Marc von der Brüggen Software-EntwicklerZYRES digital media systems GmbH
Stuttgarter Straße 25 60329 Frankfurt am Main Phone +49 (0)69 98 55 99 - 23 Fax +49 (0)69 98 55 99 - 11 Firmensitz: Stuttgarter Straße 25 60329 Frankfurt am Main Registergericht: Amtsgericht Frankfurt am Main, HRB 76374 Geschäftsführer: Sebastian Schirmer http://www.zyres.com/
smime.p7s
Description: S/MIME Cryptographic Signature
