Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SecondaryIntegrityException

3478419Sep 7 2017

Hi All,

I am getting this error :

08-31 19:05:29.986: E/AndroidRuntime(27037): FATAL EXCEPTION: pool-2-thread-1

08-31 19:05:29.986: E/AndroidRuntime(27037): Process: com.celstra.gss, PID: 27037

08-31 19:05:29.986: E/AndroidRuntime(27037): com.sleepycat.je.SecondaryIntegrityException: (JE 5.0.73) Secondary is corrupt: the primary record contains a key that is not present in the secondary

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.SecondaryDatabase.deleteKey(SecondaryDatabase.java:938)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.java:853)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.java:41)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.Database.notifyTriggers(Database.java:2122)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.Cursor.putNotify(Cursor.java:2136)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.Cursor.putNoDups(Cursor.java:2052)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.Cursor.putInternal(Cursor.java:2020)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.je.Cursor.put(Cursor.java:742)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.persist.PrimaryIndex.put(PrimaryIndex.java:397)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.sleepycat.persist.PrimaryIndex.put(PrimaryIndex.java:335)

08-31 19:05:29.986: E/AndroidRuntime(27037): at com.celstra.gss.GssPlugin$44.run(GssPlugin.java:5474)

08-31 19:05:29.986: E/AndroidRuntime(27037): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)

08-31 19:05:29.986: E/AndroidRuntime(27037): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

08-31 19:05:29.986: E/AndroidRuntime(27037): at java.lang.Thread.run(Thread.java:818)

My Environment configuration is as follows:

EnvironmentConfig envConfig=new EnvironmentConfig();

envConfig.setAllowCreate(!status);

envConfig.setReadOnly(status);

StoreConfig sConfig=new StoreConfig();

sConfig.setAllowCreate(!status);

sConfig.setReadOnly(status);

env = new Environment(FilePath, envConfig);

store = new EntityStore(env, "GSS", sConfig);

I am attaching my files after verification please suggest:

https://ufile.io/sa576

https://ufile.io/4mtiy

Please help me!

Comments

jflack

Someone correct me if I'm wrong, but I don't think what you want to do is possible.  Once a message is in the queue, you either commit and save all the enqueued messages, or rollback and save none.  So you probably need logic that will not enqueue the message with the specific key in the first place.

Or, this may be a good case for a GLOBAL TEMPORARY TABLE.  Instead of queuing your messages, INSERT them into the table.  When you need to delete one, just delete it from the table.  When you are ready to commit, loop through the table, queue the messages that are still there, then commit.

Mike Kutz

Forget slow-by-slow enqueueing.

Enqueue in bulk.

https://docs.oracle.com/database/121/ARPLS/d_aq.htm#ARPLS65296

MK

jflack

Forgot that procedure was there, thanks, Mike.

Dmitrii:  If the amount of data to be queued isn't a lot ("a lot" being a relative term) then you might skip the temporary table and just add the messages to a PL/SQL collection (TABLE OF payload type), then you can use a bulk enqueue as Mike suggests to enqueue the whole table at once.  Define the table in a package body to give it session scope.  But if the amount is large enough to have an impact on memory used, then use the table, BULK COLLECT into a collection when you read the table, and enqueue it block by block.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 5 2017
Added on Sep 7 2017
0 comments
222 views