System error, could not commit transaction XAException (null) on resuming transaction
Hello everyone, I hope you are all doing well. I write because I am facing an exception not so clear to me while writing a Java service. In this service I am using a paged list (EntityUtil.getPagedList(..)) with an iterator object retrieved using delegator.find(..) method, to process and delete a lot of records. Since the records in the target table are several hundreds of thousands, to avoid loading everything in RAM (using for example a findList method), I suspend the "service" transaction, start internally a new transaction, process and commit each page, and at the end I resume the parent transaction. I build pages of 1000 records each and I loop (start_transaction-process_data-commit) all the pages. In short the service structure is: 1.iterator <- delegator.find("ShoppingList",...) 2.suspend-parent-transaction 3.paginatedList <- EntityUtil.getPaginatedList(iterator,page1,1000) 4.while(page <= totPages): 4.a)start new transaction; 4.b)nextPage -> EntityUtil.getPagedList(iterator, page+1,1000) 4.c)delete data; 4.d) commit trx 5.finally: 5.a)close the iterator; *5.b)resume parent trx;* If the number of pages are not too high (for example 100) the service run just fine, but if the number of pages is higher (for example I tested the service with 269 pages), it commits everything as expected, but when it tries to resume the parent transaction (step *5.b*), the following exception is thrown: org.ofbiz.entity.transaction.GenericTransactionException: System error, > could not commit transaction: javax.transaction.xa.XAException (null) > at > org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:304) > ~[ofbiz-entity-test.jar:?] > at > org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:252) > ~[ofbiz-entity-test.jar:?] > at org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:546) > [ofbiz-service.jar:?] > at org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:232) > [ofbiz-service.jar:?] ... ... > Caused by: javax.transaction.xa.XAException > at > org.apache.commons.dbcp.managed.LocalXAConnectionFactory$LocalXAResource.commit(LocalXAConnectionFactory.java:214) > ~[commons-dbcp-1.4.jar:1.4] > at > org.apache.geronimo.transaction.manager.TransactionImpl.commitResource(TransactionImpl.java:622) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:305) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:266) > ~[ofbiz-entity-test.jar:?] > ... 37 more > Caused by: java.sql.SQLNonTransientConnectionException: Could not send > query: Connection reset > at > org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:125) > ~[mariadb-java-client-1.5.4.jar:?] ... ... > Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not > send query: Connection reset > at > org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:144) > ~[mariadb-java-client-1.5.4.jar:?] > at > org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:251) > ~[mariadb-java-client-1.5.4.jar:?] > at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:273) > ~[mariadb-java-client-1.5.4.jar:?] > at org.mariadb.jdbc.MariaDbConnection.commit(MariaDbConnection.java:598) > ~[mariadb-java-client-1.5.4.jar:?] > at > org.apache.commons.dbcp.managed.LocalXAConnectionFactory$LocalXAResource.commit(LocalXAConnectionFactory.java:211) > ~[commons-dbcp-1.4.jar:1.4] > at > org.apache.geronimo.transaction.manager.TransactionImpl.commitResource(TransactionImpl.java:622) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:305) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) > ~[geronimo-transaction-3.1.1.jar:3.1.1] > at > org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:266) > ~[ofbiz-entity-test.jar:?] > ... 37 more > Caused by: java.net.SocketException: Connection reset > at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) > ~[?:1.8.0_102] > at java.net.SocketOutputStream.write(SocketOutputStream.java:153) > ~[?:1.8.0_102] > at > org.mariadb.jdbc.internal.stream.PacketOutputStream.send(PacketOutputStream.java:933) > ~[mariadb-java-client-1.5.4.jar:?] I did some research and I found that some tuning on MariaDB timeouts could solve the issue (or move it later if number records are higher), but I already wrote services that stop the parent transaction to use an internal one, but I never saw this exception, and I am not quite sure on what I am doing wrong. Has anyone ever exper
Re: Add CSS/JS to backend theme from plugin
But... your plugin is a component as well, right? Just reference it like I showed below. Your plugin's ofbiz-component.xml starts with value="component://my-plugin/vendors/myscript.js" /> in your Theme.xml All out of my mind but I think this should work. Did I miss something? Regards, Michael Brohl ecomify GmbH - www.ecomify.de Am 16.02.21 um 19:52 schrieb Ingo Wolfmayr: Hi Michael, that’s what I already did - and yes it works. I am looking for a way to add js/css files to the plugin and make it available in other application. Saying: "Common-theme here are some additional files" Something like: I have a plugin that provides two files - one css and one js. I would have to create, role-out and maintain the additionial theme just for the purpose of providing two files. Best regards, Ingo -Ursprüngliche Nachricht- Von: Michael Brohl Gesendet: Dienstag, 16. Februar 2021 18:52 An: user@ofbiz.apache.org Betreff: Re: Add CSS/JS to backend theme from plugin Hi Ingo, I'm not sure if I understand correctly, but you should be able to assign ressources through a component reference. Have you tried to use in your Theme.xml? This works OOTB with ftl files, should also work with JavaScript, no? HTH, Michael Brohl ecomify GmbH - www.ecomify.de Am 16.02.21 um 17:44 schrieb Ingo Wolfmayr: Hi Aditya, I already create my own theme by extending an existing one. It works but I feel quite uncomfortable by creating a new theme for the purpose of adding a single .js file to an existing theme. I was hoping there would be a better solution and handle those things via the plugin. Thanks, Ingo -Ursprüngliche Nachricht- Von: Aditya Sharma Gesendet: Dienstag, 16. Februar 2021 16:04 An: user@ofbiz.apache.org Betreff: Re: Add CSS/JS to backend theme from plugin Hi Ingo, You may refer to documentation in themes.adoc[1]. Though I am not sure if this is the right solution, maybe you can create your own theme extending the existing one[2] HTH 1. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/theme s.adoc 2. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/theme s.adoc#extends-common-theme Thanks and regards, Aditya Sharma On Tue, Feb 16, 2021 at 5:58 PM Ingo Wolfmayr wrote: Hi everybody, is it possible to add a javascript/css from an addon to an existing backend theme. Case: I have created a plugin that provides various reports via portlets. Now I want to use the portlet logic to show those reports on different places like accounting, catalog a.s.o. Therefore I want the necessary JS/CSS files loaded for the whole theme - not for the plugin only. Long time ago I would have added those scripts via VisualThemeResource :) If possible I do not want to touch the original theme and I want to avoid creating a new plugin just for the purpose of providing those filed. Every idea would be highly appreciated. Best regards, Ingo
AW: Add CSS/JS to backend theme from plugin
Hi Michael, that’s what I already did - and yes it works. I am looking for a way to add js/css files to the plugin and make it available in other application. Saying: "Common-theme here are some additional files" Something like: I have a plugin that provides two files - one css and one js. I would have to create, role-out and maintain the additionial theme just for the purpose of providing two files. Best regards, Ingo -Ursprüngliche Nachricht- Von: Michael Brohl Gesendet: Dienstag, 16. Februar 2021 18:52 An: user@ofbiz.apache.org Betreff: Re: Add CSS/JS to backend theme from plugin Hi Ingo, I'm not sure if I understand correctly, but you should be able to assign ressources through a component reference. Have you tried to use in your Theme.xml? This works OOTB with ftl files, should also work with JavaScript, no? HTH, Michael Brohl ecomify GmbH - www.ecomify.de Am 16.02.21 um 17:44 schrieb Ingo Wolfmayr: > Hi Aditya, > > I already create my own theme by extending an existing one. It works but I > feel quite uncomfortable by creating a new theme for the purpose of adding a > single .js file to an existing theme. I was hoping there would be a better > solution and handle those things via the plugin. > > Thanks, > Ingo > > -Ursprüngliche Nachricht- > Von: Aditya Sharma > Gesendet: Dienstag, 16. Februar 2021 16:04 > An: user@ofbiz.apache.org > Betreff: Re: Add CSS/JS to backend theme from plugin > > Hi Ingo, > > You may refer to documentation in themes.adoc[1]. Though I am not sure > if this is the right solution, maybe you can create your own theme > extending the existing one[2] > > HTH > > 1. > https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/theme > s.adoc > 2. > https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/theme > s.adoc#extends-common-theme > > Thanks and regards, > Aditya Sharma > > On Tue, Feb 16, 2021 at 5:58 PM Ingo Wolfmayr > > wrote: > >> Hi everybody, >> >> is it possible to add a javascript/css from an addon to an existing >> backend theme. >> >> Case: I have created a plugin that provides various reports via portlets. >> Now I want to use the portlet logic to show those reports on >> different places like accounting, catalog a.s.o. Therefore I want the >> necessary JS/CSS files loaded for the whole theme - not for the plugin only. >> >> Long time ago I would have added those scripts via >> VisualThemeResource >> :) If possible I do not want to touch the original theme and I want >> to avoid creating a new plugin just for the purpose of providing those filed. >> >> Every idea would be highly appreciated. >> >> Best regards, >> Ingo >>
Re: Add CSS/JS to backend theme from plugin
Hi Ingo, I'm not sure if I understand correctly, but you should be able to assign ressources through a component reference. Have you tried to use value="component://my-component/vendors/myspecialscript.js" /> value="/my-theme/vendors/myscript.js" /> in your Theme.xml? This works OOTB with ftl files, should also work with JavaScript, no? HTH, Michael Brohl ecomify GmbH - www.ecomify.de Am 16.02.21 um 17:44 schrieb Ingo Wolfmayr: Hi Aditya, I already create my own theme by extending an existing one. It works but I feel quite uncomfortable by creating a new theme for the purpose of adding a single .js file to an existing theme. I was hoping there would be a better solution and handle those things via the plugin. Thanks, Ingo -Ursprüngliche Nachricht- Von: Aditya Sharma Gesendet: Dienstag, 16. Februar 2021 16:04 An: user@ofbiz.apache.org Betreff: Re: Add CSS/JS to backend theme from plugin Hi Ingo, You may refer to documentation in themes.adoc[1]. Though I am not sure if this is the right solution, maybe you can create your own theme extending the existing one[2] HTH 1. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc 2. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc#extends-common-theme Thanks and regards, Aditya Sharma On Tue, Feb 16, 2021 at 5:58 PM Ingo Wolfmayr wrote: Hi everybody, is it possible to add a javascript/css from an addon to an existing backend theme. Case: I have created a plugin that provides various reports via portlets. Now I want to use the portlet logic to show those reports on different places like accounting, catalog a.s.o. Therefore I want the necessary JS/CSS files loaded for the whole theme - not for the plugin only. Long time ago I would have added those scripts via VisualThemeResource :) If possible I do not want to touch the original theme and I want to avoid creating a new plugin just for the purpose of providing those filed. Every idea would be highly appreciated. Best regards, Ingo
AW: Add CSS/JS to backend theme from plugin
Hi Aditya, I already create my own theme by extending an existing one. It works but I feel quite uncomfortable by creating a new theme for the purpose of adding a single .js file to an existing theme. I was hoping there would be a better solution and handle those things via the plugin. Thanks, Ingo -Ursprüngliche Nachricht- Von: Aditya Sharma Gesendet: Dienstag, 16. Februar 2021 16:04 An: user@ofbiz.apache.org Betreff: Re: Add CSS/JS to backend theme from plugin Hi Ingo, You may refer to documentation in themes.adoc[1]. Though I am not sure if this is the right solution, maybe you can create your own theme extending the existing one[2] HTH 1. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc 2. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc#extends-common-theme Thanks and regards, Aditya Sharma On Tue, Feb 16, 2021 at 5:58 PM Ingo Wolfmayr wrote: > Hi everybody, > > is it possible to add a javascript/css from an addon to an existing > backend theme. > > Case: I have created a plugin that provides various reports via portlets. > Now I want to use the portlet logic to show those reports on different > places like accounting, catalog a.s.o. Therefore I want the necessary > JS/CSS files loaded for the whole theme - not for the plugin only. > > Long time ago I would have added those scripts via VisualThemeResource > :) If possible I do not want to touch the original theme and I want to > avoid creating a new plugin just for the purpose of providing those filed. > > Every idea would be highly appreciated. > > Best regards, > Ingo >
Re: Down Payment Against a Purchase Order
Hi James, Maybe my comment there helps: https://s.apache.org/rzdti HTH Jacques Le 16/02/2021 à 17:18, ja...@productive1.com a écrit : Can someone explain how you can take a deposit for a Purchase Order? How does Ofbiz handle that? Thanks, James
Down Payment Against a Purchase Order
Can someone explain how you can take a deposit for a Purchase Order? How does Ofbiz handle that? Thanks, James
Re: Add CSS/JS to backend theme from plugin
Hi Ingo, You may refer to documentation in themes.adoc[1]. Though I am not sure if this is the right solution, maybe you can create your own theme extending the existing one[2] HTH 1. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc 2. https://github.com/apache/ofbiz-framework/blob/trunk/themes/docs/themes.adoc#extends-common-theme Thanks and regards, Aditya Sharma On Tue, Feb 16, 2021 at 5:58 PM Ingo Wolfmayr wrote: > Hi everybody, > > is it possible to add a javascript/css from an addon to an existing > backend theme. > > Case: I have created a plugin that provides various reports via portlets. > Now I want to use the portlet logic to show those reports on different > places like accounting, catalog a.s.o. Therefore I want the necessary > JS/CSS files loaded for the whole theme - not for the plugin only. > > Long time ago I would have added those scripts via VisualThemeResource :) > If possible I do not want to touch the original theme and I want to avoid > creating a new plugin just for the purpose of providing those filed. > > Every idea would be highly appreciated. > > Best regards, > Ingo >
Re: Apache OFBiz Blog Updates - January 2021
Thanks Aditya! Le 16/02/2021 à 11:26, Aditya Sharma a écrit : Hi Everyone, A brief summary of our project news for January month can be found in our monthly blog update at the link below: https://s.apache.org/z8ikk This month we also share with you some highlights from 2020 with our updates about new PMC members, release, user stories, and OMS discussions along with our usual list of features, improvements, and Statistics. Thanks to Jacques Le Roux, Michael Brohl, Mridul Pathak, Pranay Pandey, Sharan Foga, Suraj Khurana, and Swapnil M Mane for their continued support. We are also actively sharing our regular updates on social media platforms. If you haven't followed us yet, here are the quick links: LinkedIn: https://s.apache.org/a181s Twitter: https://s.apache.org/12w5t Facebook: https://s.apache.org/la83r -- Thanks & Regards, Aditya Sharma
Add CSS/JS to backend theme from plugin
Hi everybody, is it possible to add a javascript/css from an addon to an existing backend theme. Case: I have created a plugin that provides various reports via portlets. Now I want to use the portlet logic to show those reports on different places like accounting, catalog a.s.o. Therefore I want the necessary JS/CSS files loaded for the whole theme - not for the plugin only. Long time ago I would have added those scripts via VisualThemeResource :) If possible I do not want to touch the original theme and I want to avoid creating a new plugin just for the purpose of providing those filed. Every idea would be highly appreciated. Best regards, Ingo
Apache OFBiz Blog Updates - January 2021
Hi Everyone, A brief summary of our project news for January month can be found in our monthly blog update at the link below: https://s.apache.org/z8ikk This month we also share with you some highlights from 2020 with our updates about new PMC members, release, user stories, and OMS discussions along with our usual list of features, improvements, and Statistics. Thanks to Jacques Le Roux, Michael Brohl, Mridul Pathak, Pranay Pandey, Sharan Foga, Suraj Khurana, and Swapnil M Mane for their continued support. We are also actively sharing our regular updates on social media platforms. If you haven't followed us yet, here are the quick links: LinkedIn: https://s.apache.org/a181s Twitter: https://s.apache.org/12w5t Facebook: https://s.apache.org/la83r -- Thanks & Regards, Aditya Sharma