Our system (It's german, Buchmanager) is a client server architecture with hibernate/spring on the backend and a remote RCP Client. Our customers have a strong demand for automated updates, as users are forced to sync their client on server updates.
The Problem: Client and server have to match and we cannot know what server version the customer is running.
The Solution: p2 queries.
At Workbench startup the client asks the server for the required client version numbers. Then we make a p2 Query with a VersionRange (as qualifier may indicate a compatible update)
Thereby we ask the repository to give us "product" IUs only matching the servers requirements. Then we use the high level api UpdateOperation to resolve an update for us. As there may be updates for a higher (=newer) server version available, we use "setSelectedUpdates" to Update only to the compatible client. this is quite easy using the equals & compareTo on Update & Version classes.IQueryResult
matches = queryable.query( QueryUtil.createIUQuery("de.eiswind.mango.client.core.mango",new VersionRange(Version.createOSGi(major, minor, micro), true, Version.createOSGi(major, minor, micro + 1), false)), new NullProgressMonitor());
I have to note that we had to remove the p2 ui bundles completely, as they would have still offered the _wrong_ update to the user. I guess that could be changed using a Policy, but that is work to come when we feel a need for a ui.
Follow me on http://twitter.com/thomas_kratz