|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Every transaction appears to run twice.I'm definitely n00b here but I was busting out code no problem when I realized that my transactions are running twice. Every one of them. They don't result in to things being added to the container so I am really baffled.
I am running a checkpointPrevayler with no saves (so it's essentially clean every time I run) I followed the Bank query pattern as in the demos. I'll do the whole code if needed but I was hoping that there are some pointers someone could give me. Note that the id generation is not deterministic but it doesn't happen inside the transaction (I don't think). The ID is essentially just the VMID. If there is a better way to do that that's fine. Again.. I call the transaction once prevayler.execute(new NutTransactionWithQuery("Cashew")); Each of the output lines happens twice but only one Nut object is stored in the Store public abstract class StoreTransactionWithQuery implements TransactionWithQuery { public Object executeAndQuery(Object store, Date date) throws Exception { System.err.println("StoreTransactionWithQuery.executeAndQuery"); return executeAndQuery((Store) store, date); } public abstract Object executeAndQuery(Store store, Date date); } // Yes, that should be named NutTransactionWithQuery public class NutTransaction extends StoreTransactionWithQuery { ID id = new ID(Utils.generateRandomID()); String type; boolean isPrimary = false; public NutTransaction() { } public NutTransaction(String type) { this.type = type; } public NutTransaction(String type, boolean isPrimary) { this(type); this.isPrimary = isPrimary; } public Object executeAndQuery(Store store, Date date) { System.err.println("NutTransaction.executeAndQuery - date is : " + date); Nut nut = new Nut(); nut.setID(id); System.err.println("NutTransaction.executeAndQuery - id is : " + nut.getID()); nut.setType(type); nut.setPrimary(isPrimary); // add the nut to the store store.add(nut); // Now get it back from the store (to be sure) and return it. return store.getNut(nut.getID()); } } Any help would be greatly appreciated ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org |
|
|
Re: Every transaction appears to run twice.Rick Ross wrote: > I'm definitely n00b here but I was busting out code no problem when I > realized that my transactions are running twice. Every one of them. > They don't result in two things being added to the container so I am > really baffled.[...] > > Again.. I call the transaction once prevayler.execute(new > NutTransactionWithQuery("Cashew")); Each of the output lines > happens twice but only one Nut object is stored in the Store I may be a little out of touch with what Prevayler's defaults are these days, but that sounds like the food taster. One of the issues with Prevayler is that if a transaction blows up in the middle, it blows up on the live data, with no good way to do rollback. So Prevayler can be configured to keep a second copy of all your data and run the transaction once on the spare copy. If it doesn't throw an exception, then it runs it on the real copy. William ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org |
|
|
Re: Every transaction appears to run twice.William is right. You can turn that off by doing
PrevaylerFactory.configureTransactionFiltering(false) On Mon, Feb 16, 2009 at 11:36 PM, William Pietri <william@...> wrote: > > > Rick Ross wrote: >> I'm definitely n00b here but I was busting out code no problem when I >> realized that my transactions are running twice. Every one of them. >> They don't result in two things being added to the container so I am >> really baffled.[...] >> >> Again.. I call the transaction once prevayler.execute(new >> NutTransactionWithQuery("Cashew")); Each of the output lines >> happens twice but only one Nut object is stored in the Store > > I may be a little out of touch with what Prevayler's defaults are these > days, but that sounds like the food taster. > > One of the issues with Prevayler is that if a transaction blows up in > the middle, it blows up on the live data, with no good way to do > rollback. So Prevayler can be configured to keep a second copy of all > your data and run the transaction once on the spare copy. If it doesn't > throw an exception, then it runs it on the real copy. > > William > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion > _______________________________________________ > "Databases in Memoriam" -- http://www.prevayler.org > ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org |
|
|
Re: Every transaction appears to run twice.Aww.. Awesome!! Thanks guys. I hate problems like this where if I
was really wrong, then I didn't really have a clue. Big relief My original tests showed the deteriminism problem so now I just have to run into the baptism problem :-) R On Feb 16, 2009, at 7:41 PM, Klaus Wuestefeld wrote: > William is right. You can turn that off by doing > PrevaylerFactory.configureTransactionFiltering(false) > > > > On Mon, Feb 16, 2009 at 11:36 PM, William Pietri > <william@...> wrote: >> >> >> Rick Ross wrote: >>> I'm definitely n00b here but I was busting out code no problem >>> when I >>> realized that my transactions are running twice. Every one of >>> them. >>> They don't result in two things being added to the container so I am >>> really baffled.[...] >>> >>> Again.. I call the transaction once prevayler.execute(new >>> NutTransactionWithQuery("Cashew")); Each of the output lines >>> happens twice but only one Nut object is stored in the Store >> >> I may be a little out of touch with what Prevayler's defaults are >> these >> days, but that sounds like the food taster. >> >> One of the issues with Prevayler is that if a transaction blows up in >> the middle, it blows up on the live data, with no good way to do >> rollback. So Prevayler can be configured to keep a second copy of all >> your data and run the transaction once on the spare copy. If it >> doesn't >> throw an exception, then it runs it on the real copy. >> >> William >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San >> Francisco, CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source >> code: SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >> _______________________________________________ >> "Databases in Memoriam" -- http://www.prevayler.org >> > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source > code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion > _______________________________________________ > "Databases in Memoriam" -- http://www.prevayler.org > ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org |
|
|
Re: Every transaction appears to run twice.> so now I just have
> to run into the baptism problem :-) Courage! You'll get there! :) ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org |
| Free embeddable forum powered by Nabble | Forum Help |