Transactions that haven't yet committed aren't written to the logical log so
if you're about to check this at runtime it cannot be done in the same way.
What you'd have to do is to monitor the transactions that are alive and
maybe tie each to a client so that they can be rolled back if they get old
without being finished. You can get a hold of the TransactionManager using:


(AbstractGraphDatabase)graphDb).getConfig().getTxModule().getTxManager();

which can be used to suspend/resume/rollback transactions.

2011/7/31 Felipe Oliveira Carvalho <felipe...@gmail.com>

> How can I check if there are unfinished transactions? I want to do the
> same thing that is done when EmbeddedGraphDatabase is instantiated
> after a non-clean shutdown.
>
> Jul 31, 2011 5:06:12 PM
> org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog
> doInternalRecovery
> INFO: Non clean shutdown detected on log
> [/home/felipe/graph.db/nioneo_logical.log.2]. Recovery started ...
> Jul 31, 2011 5:06:12 PM org.neo4j.kernel.impl.transaction.TxManager init
> INFO: Unresolved transactions found, recovery started ...
> Jul 31, 2011 5:06:12 PM org.neo4j.kernel.impl.transaction.TxManager init
> INFO: Recovery completed, all transactions have been resolved to a
> consistent state.
>
> Is it too slow? I want to check if there are unfinished transactions
> to roll back them all.
>
> I'm writing a server and clients may not call finish() for some reason
> (unexpected errors) disobeying
> http://wiki.neo4j.org/content/Neo_Mistakes#Transactions_usage. I want
> to cleanup transactions on every new client connection so that every
> connection starts clean.
>
> Thanks,
> Felipe
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to