|
Re: [CDO] Offline clone doesn't reload offline branche [message #1007556 is a reply to message #1007501] |
Wed, 06 February 2013 13:04 |
|
Am 06.02.2013 09:40, schrieb Ricky de Klerck:
> Hi,
>
> When doing modifications in offline mode, a new offline branche is created. When closing and restarting the
> application the wrong branche is loaded. The changes that I've made in offline mode are gone.. Is this a bug or am I
> doing something wrong?
Neither, I'd say. You're probably just missing a minor but important step if you want to keep working in offline
branches across application restarts.
First, changes in a repo are never gone if auditing (or branching) is enabled. Especially branches can not be deleted.
Second, to be able to work with these offline branches after a client restart this client must store the ID of this
branch somewhere, e.g. in the file system. Here's some example code:
int branchID = loadBranchID();
CDOBranch branch = session.getBranchManager().getBranch(branchID);
CDOTransaction transaction = session.openTransaction(branch);
transaction.addListener(new IListener()
{
public void notifyEvent(IEvent event)
{
if (event instanceof CDOViewTargetChangedEvent)
{
CDOViewTargetChangedEvent e = (CDOViewTargetChangedEvent)event;
int branchID = e.getBranchPoint().getBranch().getID();
storeBranchID(branchID);
}
}
};
Does that help?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03095 seconds