Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Location of Persistent UserAdmin Data

> In summary bundle ids do not change between framework launches, but if you
> update a bundle using Eclipse update it actually uninstalls the old version
> and installs the new version, resulting in a new bundle id.

Yeah, this is what I was getting at.  I should have been more explicit in my comments about bundle ids changing that I was talking about behavior I've noticed in Equinox and that it's not an issue with the OSGi spec itself. 

For example, here's a snapshot of my Equinox runtime in one framework execution:
 
osgi> ss
Framework is launched.
id State Bundle
0 ACTIVE system.bundle_3.2.0.v20060510
14 ACTIVE my.app.usergroupadmin_1.0.0
27 ACTIVE org.eclipse.equinox.useradmin_1.0.0.qualifier
28 ACTIVE org.eclipse.osgi.services_3.1.100.v20060511
osgi>
 
If I shutdown the framework, change the launch config to start a new bundle and restart the framework with the "-clean" option here's what the status looks like:
 
osgi> ss
Framework is launched.
id State Bundle
0 ACTIVE system.bundle_3.2.0.v20060510
15 ACTIVE my.app.usergroupadmin_1.0.0
27 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060510
28 ACTIVE org.eclipse.equinox.useradmin_1.0.0.qualifier
29 ACTIVE org.eclipse.osgi.services_3.1.100.v20060511
osgi>
 
In the second framework launch the useradmin bundle has an id of 28.  So any preference values stored under "org.eclipse.core.runtime.preferences.OSGiPreferences.27.prefs" are inaccessible to the user admin bundle in the second launch.
 
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=124176#c10
 
Thanks for the pointer to the bugzilla page.
 
Are there any recommended workarounds to use to get around this limitation?
 
Thanks,
Ben
 
On 6/1/06, BJ Hargrave <hargrave@xxxxxxxxxx > wrote:
Bundle ids cannot change between framework launches. The bundle id is the
primary key of the bundle and may not change or ever be reused within a
framework instance.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx
Office: +1 407 849 9117 Mobile: +1 386 848 3788



"Benjamin Schmaus" < benjamin.schmaus@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
2006-06-01 12:46 PM
Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>


To
equinox-dev@xxxxxxxxxxx
cc

Subject
[equinox-dev] Location of Persistent UserAdmin Data






Equinox Developers,

I've been developing a user/group admin bundle that runs on top of the
Equinox OSGi UserAdmin service  implementation, and I've noticed that data
is persisted to a file that is named like so:

"org.eclipse.core.runtime.preferences.OSGiPreferences." +
bundle.getBundleId()

So the actual file name might end up being something like:
" org.eclipse.core.runtime.preferences.OSGiPreferences.27.prefs "

Since a bundle's id can change between framework starts and stops, users
and roles created by a given bundle during one execution of the framework
won't necessarily be available to that bundle in another execution of the
framework ( i.e. since bundle id can vary across runs).

Should a bundle have to re-create user and role assignments on every start
of the framework if persistent data can't be located?  That doesn't seem
right to me.

It could be that user admin data can be persisted to a static (known
before runtime) location via the Equinox UserAdmin impl, but it's not
clear to me how this should be done.

- Ben Schmaus_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top