There are a few things you should be careful about while working with GemFire cache transactions and external databases:
The BEGIN statement, database operations and the PREPARE statement must all happen in the same connection session. In order to accomplish this, you will need to obtain the same JDBC connection session across multiple CacheWriter and TransactionWriter/TransactionListener invocations. One way to do this would be to lookup the connection (from a user managed Map) based on cacheTransactionManager.getTransactionId().
Make sure that the prepare transaction feature is enabled in your external database. For example, it is disabled in PostgreSQL by default. In PostgreSQL, the following property must be modified to enable it:
If you have not previously committed a previous transaction in this connection, start a database transaction by issuing a BEGIN statement.
At this point, the TransactionWriter is invoked. The TransactionWriter returns a TransactionEvent, which contains all the operations in the transaction. Call PREPARE TRANSACTION within your TransactionWriter code.
After a transaction is successfully committed in GemFire, TransactionListener is invoked. Call COMMIT PREPARED in the TransactionListener to commit the database transaction.
Short Description You've thwarted their plots, but never gotten close to an actual vampire. Now, you've got a vampire's travel plans. You know where he's going & how he's getting there. You've finally got the edge.
Short Description This annual seminar covers the latest news about new releases & upcoming projects from Joseph Goodman & his crew of writers, artists, & game designers is a highly-anticipated Gen Con event.
Yesterday I did the first speedwork of the year, 5x800 (4:22, 4:20, 4:18, 4:09, 4:13). Not great, but ok splits for someone trying to recover from a very mild cold - a cold so mild that I never got sick enough to skip work or other commitments. I was just very, very tired and slightly sniffly and had the lingering feeling that my head was stuffed full of jello. Christmas bug, you win...
Day 2 - Turn leftover sauce into gazpacho with the addition of salt, water, tomato paste, vinegar, hot sauce, great glugs of olive oil and two punchy cloves of garlic. (Do not consume immediately prior to interview, meeting or generally any human interaction.)
"Stop wasting energy on letting 'talentless' be a stumbling block!" - sage advice from my runnerd friend Desiree, when I complained I was struggling with being talentless and...you know... genetically challenged.
This is much harder to write. In this age of facebook and twitter and dailymile and athlinks, it's so easy to compare myself with other people. Other people who have been running, not even semi-seriously, for half as long as I have, and who are so talented they are able to waltz in and run my times with half the work. (And are genuinely nice people. And hot. And have the supernatural ability to not be a dishevelled, soggy mess after a workout - I am not one of those girls.)
I've had this struggle as long as I do...pretty much anything I love. There will always be more talented writers, more talented runners, more talented dancers. At least running is objective - a time is a time is a time. In the arts, the choreographer or dance instructor can have favourites, the publisher and prize committee can pick and choose.
It doesn't help to console myself with the knowledge that I work *hard* for everything I have - because the people with more talent work just as hard and shine brighter.
I must add: it's impossible to be miserable while running solo. I might be more or less tired than usual, but never miserable. It's when I run with other people that the trouble starts: other people motivate me, but I'm miserable when everyone else disappears into the distance (ahem, upcoming Green Corridor Run) and I am dead last.
I know comparing is a waste of energy, that I should buckle down and work even harder and keep breaking my PRs. But it's hard not to compare.