Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Troubleshooting Guide Page 66

  • Download
  • Add to my manuals
  • Print
  • Page
    / 286
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 65
66
BlackBerry Java Development Environment Development Guide
Manage persistent data
Data integrity To maintain the integrity of data in persistent storage, partial updates are not made if an error occurs during
a commit. Data in the
PersistentObject retains the values from the last commit in order to preserve data
integrity.
If the JVM performs an emergency garbage collection operation due to low memory, outstanding transactions
are committed immediately to avoid compromising data integrity. If the BlackBerry device fails during this
operation, partially completed transactions are committed when the BlackBerry device starts. Outstanding
transactions are not committed during a normal garbage collection operation.
Task Steps
Create a unique long key. Each PersistentObject has a unique long key.
1. In the BlackBerry® Integrated Development Environment, type a string value, such as
com.rim.samples.docs.userinfo.
2. Select this string.
3. Right-click this string and click Convert ‘com.rim.samples.docs.userinfo’ to long.
4. Include a comment in your code to indicate the string that you used to generate the unique long key.
Create a persistent data
store.
1. Create a single static PersistentObject.
static PersistentObject store;
2. Invoke PersistentStore.getPersistentObject, using the unique long key as a parameter.
static {
store = PersistentStore.getPersistentObject( 0xa1a569278238dad2L );}
Store an object persistently. 1. Invoke setContents() on a PersistentObject. This method replaces existing content with the new
content.
2. To save the new content to the persistent store, invoke commit().
String[] userinfo = {username, password};
synchronized(store) {
store.setContents(userinfo);
store.commit();}
Store objects in a batch
transaction.
1. To use a batch transaction to commit objects to the persistent store, invoke
PersistentStore.getSynchObject(). This method retrieves the persistent store monitor that locks
the object.
2. Synchronize on the object.
3. Invoke commit() as necessary. If any commit in the batch fails, the entire batch transaction fails.
Commit a monitor object
separately from a batch
transaction.
>Invoke forceCommit() while synchronizing the monitor object.
Feature Description
Page view 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 285 286

Comments to this Manuals

No comments

Sony HVR-1500A Handbücher

Bedienungsanleitungen und Benutzerhandbücher für CD Spieler Sony HVR-1500A.
Wir stellen PDF-Handbücher Sony HVR-1500A zum kostenlosen herunterladen nach Dokumenttypen zur Verfügung






Weitere Produkte und Handbücher für CD Spieler Sony

Modelle Dokumententyp
CDX-V58MP Bedienungsanleitung   Sony CDX-V58MP User's Manual, 4 Seiten
D-VJ85 Bedienungsanleitung   Sony D-VJ85 User manual, 36 Seiten
MDX-C8900R Bedienungsanleitung    Sony MDX-C8900R Manual de usuario, 186 Seiten
HDX266/HDX267W Bedienungsanleitung   Sony HDX266/HDX267W User's Manual, 104 Seiten
CDX-M10 Betriebsanleitung       Sony CDX-M10 Operating Instructions, 116 Seiten
MEX-BT2700 Bedienungsanleitung    Sony MEX-BT2700 User's Manual, 56 Seiten
CDP-M555ES Bedienungsanleitung   Sony CDP-M555ES User's Manual, 48 Seiten
CDX-M30 Bedienungsanleitung       Sony CDX-M30 User's Manual, 144 Seiten
D-E660 Bedienungsanleitung   Sony D-E660 User's Manual, 32 Seiten
D-MJ95 Bedienungsanleitung   Sony D-MJ95 User manual, 28 Seiten
D-F21 Bedienungsanleitung   Sony D-F21 User manual, 24 Seiten
D-E561 Bedienungsanleitung   Sony D-E561 User's Manual, 2 Seiten
CDX-434RF Bedienungsanleitung    Sony CDX-434RF User manual, 4 Seiten
CDP-CX335 Bedienungsanleitung    Sony CDP-CX335 User manual, 68 Seiten
D-E551 Bedienungsanleitung   Sony D-E555 User manual, 2 Seiten
CDX-C910 Bedienungsanleitung    Sony CDX-C910 User manual, 62 Seiten
HAR-D1000 Bedienungsanleitung   Sony HAR-D1000 User's Manual, 36 Seiten
CFD-360 Bedienungsanleitung    Sony CFD-360 User manual, 60 Seiten
D-SJ01 Bedienungsanleitung   Sony D-SJ01 User manual, 24 Seiten
CFD-577 Bedienungsanleitung   Sony CFD-577 User manual, 36 Seiten