Database Adapter: Insert, relationships, sequences and problems of course

Hello Everyone!!
I'm trying to do an insert in an Oracle Express Database with a database adapter. I'm trying to do the insert in two tables: SOLICITUDES with a column called NUMSOLICITUD that is also the primary key of the table and it's populated from its own sequence and the other table whose name is DOCJUST with a field NUMSOL. SOLICITUDES has a 1:M relationship with DOCJUST and the fields used in this relationship are NUMSOLICITUD and NUMSOL. The problem is that when the adapter do the insert, the first insert made on SOLICITUDES is correct, but when it tries to insert in the DOCJUST table, when it's supposed to insert in NUMSOL the same value inserted in NUMSOLICITUDES instead of that, a NULL value is inserted in NUMSOL so the process fails. Is it because the NUMSOLICITUDES column is populated from a sequence? How can I resolve that?
Thanks!!

Hi,
OK, I found the following article: http://soa-bpel-esb.blogspot.com/2010/04/understanding-catch-and-catchall.html
Using the info from that article I have created a test flow, which contains the same insert database adapter as the production flow. I have placed the Invoke within its own scope and attached a "CatchAll" block to this scope. To this block I have added a "empty" step (do nothing).
In my tests, I see the desired results i.e. the second time I initiate the flow with the same data, the CatchAll block executes, which does nothing, and processing continues after the scope.
So far so good - my query is how would I catch the specific error of unique index violation rather than general catchall?
As before, and assistance/comments greatly appreciated.
Anit

Similar Messages

  • Error in Database Adapter Insert Or Update (Merge) Operation

    I have a simple SOA composite which reads XML files and posts data to a database table using a database adapter. I would like to perform a merge operation but I keep getting this error in the log -
    SEVERE: JCABinding=> XML2DB:WriteInvToDB [ WriteInvToDB_ptt::merge(InventoryCollection) ] Could not invoke operation 'merge' against the 'Database Adapter' due to:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Here is the complete log:
    SEVERE: JCABinding=> XML2DB:WriteInvToDB [ WriteInvToDB_ptt::merge(InventoryCollection) ] Could not invoke operation 'merge' against the 'Database Adapter' due to:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Please see the logs for the full DBAdapter logging output prior to this exception.
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    SEVERE: JCABinding=> [default/XML2DB!1.0*2008-12-23_13-27-06_078.WriteInvToDB]:merge One-way interaction failed
    Jan 3, 2009 10:58:06 AM oracle.tip.mediator.serviceEngine.MediatorServiceEngine post2Mesh
    SEVERE: Post 2 messah failed
    oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'merge' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.EndpointInteractionException.getFabricInvocationException(EndpointInteractionException.java:74)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:226)
         at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:153)
         at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
         at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
         at sun.reflect.GeneratedMethodAccessor253.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
    Caused by: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'merge' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:428)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:509)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:493)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:429)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:193)
         ... 49 more
    Caused by: BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    merge failed. Descriptor name: [WriteInvToDB.Inventory].
    Caused by java.lang.NullPointerException.
    Please see the logs for the full DBAdapter logging output prior to this exception.
         at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:488)
         at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:529)
         at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:287)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:311)
         ... 53 more
    Caused by: java.lang.NullPointerException
         at oracle.toplink.descriptors.DescriptorQueryManager.putCachedUpdateCalls(DescriptorQueryManager.java:1605)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.prepareUpdateObject(ExpressionQueryMechanism.java:1608)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.updateObject(StatementQueryMechanism.java:405)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1136)
         at oracle.toplink.queryframework.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:69)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:279)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    WARNING: JCABinding=> ReadXML ReadXMLonReject: The resource adapter 'File Adapter' requested handling of a malformed inbound message. However, the following Service property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy the module. Will use the default Rejection Directory file://jca\ReadXML\rejectedMessages for now.
    Jan 3, 2009 10:58:06 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
    WARNING: JCABinding=> ReadXML ReadXMLonReject: Sending invalid inbound message to Exception Handler:
    Jan 3, 2009 10:58:06 AM oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread run
    SEVERE: Failed to enqueue error message
    javax.jms.TransactionInProgressException: Cannot call commit on a XA capable JMS session.
         at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:595)
         at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:846)
         at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:840)
         at oracle.j2ee.ra.jms.generic.SessionWrapper.commit(SessionWrapper.java:197)
         at oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread.run(ErrorMessageEnqueuer.java:187)
         at java.lang.Thread.run(Thread.java:595)
    Any help is greatly appreciated.
    The INSERT operation works fine with the database adapter, but I cannot get MERGE and UPDATE operations to work as expected!
    Thanks.

    hi Sudeep,
    We are at first hand struggling with DB adapter problem getting down everytime. Don't know the reason why.
    DB adapter is in down state and when trying to make it up gives below error:
    "weblogic.application.ModuleException: weblogic.connector.exception.RAException: Jndi Name is null or empty."
    I just created a simple sync process using DB adapter (custom select) and deplyed successfully. I hope jndi name is not to be configured in weblogic-ra.xml file.
    This is the first time we are using this JNDI name (eis/DB/calvindb).
    Any inputs will be appreciated.
    Thanks,
    Nikhil

  • Improve Database adapter insert performance

    Hopefully this is an easy question to answer. I'm getting passed to my BPEL over 8,000 records and I need to take those records and then insert them into an Oracle database. I've been trying to tune the insert by using properties like inMemoryOptimization, but the load still takes severl hours. Any suggestions on how to get the Database adapter to perform better or load all 8,000 records at once? thanks in advance.

    Hello.
    8000 records doesn't sound "huge", unless a record is say 1 kB then you have 8 MB, which is a large payload to move around in one piece.
    A DB merge is typically slower than an insert, though you did say you were using an insert.
    If you are inserting each row one at a time that seems like it would be pretty slow.
    Normally the input to a DB adapter insert is a collection (of rows) vs. a single row. If you have been handed 8000 individual rows you can assemble them into a collection with an iteration - tedious in BPEL but works fine.
    Daren

  • Database Adapter-Insert

    Hi,
    I am new to BPEL. I am trying to learn through tutorials. I am working on Insert tutorial (Database Adapters).
    I was able to compile the project sucessfully in jdev and deploy to Bpel server.
    After giving the input and hitting on post xml message the follwing error comes up:
    file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_Insert_1.0_3955c8686706b0e75f228f767a18cf38.tmp/InsertService.wsdl [ InsertService_ptt::insert(MoviesCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [Insert.Movies]. [Caused by: JDBC 2.0 feature is not yet implemented]
    ; nested exception is:
         ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [Insert.Movies]. [Caused by: JDBC 2.0 feature is not yet implemented]
    Caused by Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: JDBC 2.0 feature is not yet implementedError Code: 0.
    Does anyone have idea about this error?
    My settings in oc4j_ra.xml are as below:
    <connector-factory location="eis/DB/BPELSamples" connector-name="Database Adapter">
              <config-property name="xADataSourceName" value=""/>
              <config-property name="dataSourceName" value=""/>
              <config-property name="platformClassName" value="oracle.toplink.internal.databaseaccess.OraclePlatform"/>
              <config-property name="usesNativeSequencing" value="true"/>
              <config-property name="sequencePreallocationSize" value="50"/>
              <config-property name="defaultNChar" value="false"/>
              <config-property name="usesBatchWriting" value="true"/>
              <config-property name="driverClassName" value="oracle.lite.poljdbc.POLJDBCDriver"/>
              <config-property name="connectionString" value="jdbc:polite4@localhost:1531:orabpel"/>
              <config-property name="userName" value="system"/>
              <config-property name="password" value="manager"/>
              <config-property name="minConnections" value="1"/>
              <config-property name="maxConnections" value="5"/>
              <config-property name="minReadConnections" value="1"/>
              <config-property name="maxReadConnections" value="5"/>
              <config-property name="usesExternalConnectionPooling" value="false"/>
              <config-property name="usesExternalTransactionController" value="false"/>
              <connection-pooling use="none">
              </connection-pooling>
              <security-config use="none">
              </security-config>
         </connector-factory>
    and datasources.xml is
    <connection-pool name="BPELPM_CONNECTION_POOL">
    <connection-factory factory-class="oracle.lite.poljdbc.POLJDBCDriver"
    user="system"
    password="manager"
    url="jdbc:polite4@localhost:1531:orabpel" />
    </connection-pool>
    <managed-data-source name="BPELServerDataSource"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELServerDataSource" tx-level="global"/>
    <managed-data-source name="BPELServerDataSourceWorkflow"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELServerDataSourceWorkflow" tx-level="local"/>
    <!--managed-data-source name="BPELSamplesDataSource"
    connection-pool-name="BPELPM_CONNECTION_POOL"
    jndi-name="jdbc/BPELSamplesDataSource" tx-level="global" /-->
    I have a database connection called bpel samples in jdev. Can anyone help me in creating bpel process to insert data in a table using database adapters.
    I am not able to get any output for any of the database adapter tutorials. Any hints????
    Thanks in advance.
    Edited by: user3833651 on Apr 22, 2009 8:17 PM

    The database version is only important with the dehydration store. If you are using the adapters to select / delete / update / insert data into your application it comes down to the jdbc drivers. Basically if you are above 8i you should be fine.
    olite is a very basic database, and the jdbc drivers are flaky, it's also not based on the Oracle code, therefore is not upgradable if you want to increase performance. You would need to perform some manual steps to migrate to a standard database.
    If you are wanting to do basic tutorials and don't want to have a heavy database using all your resources, use oracle XE. No need to pact. If you have a oracle database installed somewhere use that.
    http://www.oracle.com/technology/software/products/database/xe/index.html
    cheers
    James

  • Database Adapter insert operation with return value

    Hi All,
    I have a table with auto generate parimary key in DB2 database. I need to have an insert operation ont this table which should return current value of primary key after insert.
    For this , I have created an insert operation in DB Adapter. But this insert operation in oneway operation.
    Is there any way I can create an Insert operation in DB2 adapter which returns the primary key value?
    Thanks
    --Sree                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Sree,
    With insert operation it is not possible. You may use stored procedure/function to perform insert and return the required value, and call this SP/function using DB Adapter.
    Regards,
    Anuj

  • Can we split and fetch the records in Database Adapter

    Hi,
    I designed a Database Adapter to fetch the records from oracle Database. Some time, the Database Adapter need to fetch around 5000, or 10,000 records in single shot. In that case my BPEL process is choking and getting error as
    java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    Could someone help me to resolve this?
    In Database Adapter can we split and fetch the records, if number of records more then 1000.
    ex. First 100 rec as one set and next 100 as 2nd set like this.
    Thank you.

    You can send the records as batches useing the debatching feature of db adapter. Refer documentation for implementation details.

  • OVD: Database Adapter Query Problem

    Hey Everyone,
    I am using a database adapter in OVD 10g and am not able to get the proper results from a query. We have created a view in the database and have pointed OVD at the view. We then set up 7 objectclasses using the DB Attribute Mapping Wizard. When doing a query on the base of the DB adapters we are not getting back all of the proper results one would expect. For instance if I query for objectclass=* I only get back 2 of the 7 objectclasses. Another example would be a query for mail=[email protected] will only return the attributes from the mailRecipient objectclass when normally in LDAP the entire record would be returned.
    Does anyone have an idea as to what could be going on? Does anyone have additional resources (beyond the OVD manual) for creating a database adapter?
    Thanks,
    Stephen

    Sorted this out:
    Used custom URL and made sure that the OVD Manager IDE was not appending any additional information following the closing bracket of the URL.
    The full successful URL was as follows with no values in any of the other fields:
    jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1540))(ADDRESS = (PROTOCOL = TCP)(HOST = host2)(PORT = 1540))(CONNECT_DATA=(SERVICE_NAME=SNAME)))

  • Transaction commit in database adapter

    Hi,
    When the commit happens when a database adapter inserts a record.
    I have two invoke process one is db adapter to insert records and second the db adapter to call the procedure to update the records inserted by first adapter, but will the records will be visible in the second adapter.
    Please advice, thanks in advance.
    Regards,
    SReejit

    Yes because it is one transaction, therfore you can roll back if the second fails.
    But if you perform a dehydration, e.g. wait, human task, receive activity then the first insert will be committed. so you will not be able to roll back. You will need to use a compensate activity.
    cheers
    James

  • Help on Database Adapter

    Hi,
    I am new to ESB and webMethods. I am trying to get the data from xml file and store them in database tables. I was able to run the program without any errors, but not able to store the values in database tables.
    I used file adapter to get the data, used routing service and database adapter map the data and connect to oracle instance. Every thing is working fine.
    I used insert only template in database adapter. Can anyone please help me to how to commit the values in database?
    Thanks
    Ramana.

    Hi,
    Thanks for the reply. I found in ESB instance that every thing is fine. Under the status column it see a tick mark. And I am new to ESB integration I have installed ESB and JDeveloper yesterday and started working on it. I don’t know where to check the logs or traces.
    I have installed SOL 10.1.3.1 and jdevstudio 10.1.3.1 for Windows XP.
    Can you please tell me how to check the logs that.
    Regards
    Rao.

  • Unable to import table using SOA database adapter in Jdev

    hi all,
    I am learning soa 11g development by myself which is quite exciting stuff.
    I am trying to build a simple flow to access database so I have dropped a database adapter in composite.xml and trying to configure the adapter.
    I have successfully tested the database connection within the adapter configuration wizard and can list the tables as well. But when I am selecting a table to import then I don't see any table imported in Step-5.
    It doesn't show me any error. I have tried with other tables and also with other databases but can't import the tables.
    Any advice will be appreciated.
    Oracle SOA Version11.1.1.4.0
    JDeveloper Version 11.1.1.6.0
    Thanks,
    Raj

    Hi Raj,
    You have to select the required tables and move it to the blank area on right side of your selection window by clicking the arrow button.
    cheers

  • Unable to import table using SOA database adapter in jdeveloper

    I am trying to build a simple flow to access database so I have dropped a database adapter in composite.xml and trying to configure the adapter.
    I have successfully tested the database connection within the adapter configuration wizard and can view the tables as well.
    But when I am selecting a table to import then I don't see any table imported in Step-5.
    It doesn't show me any error. I have tried with other tables and also with other databases but can't import the tables
    i have selected the table using the right arrow to right side and then clicked "OK". But the table hasn't come-up and it still says "No tables imported" in Step 5. I am trying to import from oracle database using oracle jdbc.
    am doing Perform an operation(Select query) on a table
    Regards,
    Kishor M

    Thread moved form Japanese SOA Suite.

  • Database adapter exception not caught

    Hello,
    I am testing a BPEL orchestration that was running overnight. This process was handling a lot of database transactions that would take quite some time to run. Sometime during the run the database adapter could not connect and an exception was thrown causing the instance to go into an open.faulted state. In the BPEL orchestration I have a Catch-All at the global scope to handle all uncaught exceptions, but apparently this one exception did not get caught. I have had database exceptions thrown and caught previously in other runs, but I am concerned why this one was not handled. Can anyone provide some insight on why this happened and how this can be prevented. I am using 10.1.3.4
    Thanks,
    Jim

    What was the fault. Have you any faults / configuration defined in the BPEL fault framework?
    cheers
    James

  • JCA Database adapter - stored procedure xa or non xa datasource

    Hi
    I have a quick question about datasources. Does the database adapter support both xa and non xa? I am currently running in non xa I really do not need any xa functionality, but I am experiencing some calls to the database that takes a very long time. Might be an issue with the database tuning, but trying to cover all the bases.
    Have searched quite a lot on it, but cant find anything, so I hope some of you know.
    Thanks in advance.
    /Øyvind

    Does the database adapter support both xa and non xa? Yes, it supports both.
    but I am experiencing some calls to the database that takes a very long time. May be database is slow or data-source is not fine tuned. Does it happen under heavy load? What is the independent normal execution time and how much it is taking actually when you use DB adapter?
    Regards,
    Anuj

  • Problem inserting a clob using bpel and database adapter

    We are having issues inserting a clob field into the database when the data is over 4000 characters. Anything under 4000 characters works fine.
    The error we are seeing is "Error while converting to a Java struct object. Unable to convert XSD element P_RESPONSE_ARRAY_ITEM whole user defined type is QC_CRCBT_PKG_RESPONSE_TYPE. Cause: java.lang.ClassCastException: oracle.sql.CLOB; nested exception is: ORABPEL-11802"
    We are using BPEL 10.1.3.3 and a database adapter. THE PL/SQL parameter decomposes to a clob type. Again, anything under 4000 characters works fine.
    Any ideas?

    This is likely due to Bug-6629539, which has just been identified and fixed in 11. You can request a one-off patch for this bug (i.e. a BLR off of the 10.1.3.3.0 release label).

  • Problem using secondary database, sequence (and custom tuple binding)

    I get an exception when I try to open a Sequence to a database that has a custom tuple binding and a secondary database. I have a guess what the issue is (below), but it boils down to my custom tuple-binding being invoked when opening the sequence. Here is the exception:
    java.lang.IndexOutOfBoundsException
    at com.sleepycat.bind.tuple.TupleInput.readUnsignedInt(TupleInput.java:4
    14)
    at com.sleepycat.bind.tuple.TupleInput.readInt(TupleInput.java:233)
    at COM.shopsidekick.db.community.Shop_URLTupleBinding.entryToObject(Shop
    _URLTupleBinding.java:72)
    at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java
    :73)
    at COM.tagster.db.community.SecondaryURLKeyCreator.createSecondaryKey(Se
    condaryURLKeyCreator.java:38)
    at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.
    java:546)
    at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.ja
    va:42)
    at com.sleepycat.je.Database.notifyTriggers(Database.java:1343)
    at com.sleepycat.je.Cursor.putInternal(Cursor.java:770)
    at com.sleepycat.je.Cursor.putNoOverwrite(Cursor.java:352)
    at com.sleepycat.je.Sequence.<init>(Sequence.java:139)
    at com.sleepycat.je.Database.openSequence(Database.java:332)
    Here is my code:
    // URL ID DB
    DatabaseConfig urlDBConfig = new DatabaseConfig();
    urlDBConfig.setAllowCreate(true);
    urlDBConfig.setReadOnly(false);
    urlDBConfig.setTransactional(true);
    urlDBConfig.setSortedDuplicates(false); // No sorted duplicates (can't have them with a secondary DB)
    mURLDatabase = mDBEnv.openDatabase(txn, "URLDatabase", urlDBConfig);
    // Reverse URL lookup DB table
    SecondaryConfig secondaryURLDBConfig = new SecondaryConfig();
    secondaryURLDBConfig.setAllowCreate(true);
    secondaryURLDBConfig.setReadOnly(false);
    secondaryURLDBConfig.setTransactional(true);
    TupleBinding urlTupleBinding = DataHelper.instance().createURLTupleBinding();
    SecondaryURLKeyCreator secondaryURLKeyCreator = new SecondaryURLKeyCreator(urlTupleBinding);
    secondaryURLDBConfig.setKeyCreator(secondaryURLKeyCreator);
    mReverseLookpupURLDatabase = mDBEnv.openSecondaryDatabase(txn, "SecondaryURLDatabase", mURLDatabase, secondaryURLDBConfig);
    // Open the URL ID sequence
    SequenceConfig urlIDSequenceConfig = new SequenceConfig();
    urlIDSequenceConfig.setAllowCreate(true);
    urlIDSequenceConfig.setInitialValue(1);
    mURLSequence = mURLDatabase.openSequence(txn, new DatabaseEntry(URLID_SEQUENCE_NAME.getBytes("UTF-8")), urlIDSequenceConfig);
    My secondary key creator class looks like this:
    public class SecondaryURLKeyCreator implements SecondaryKeyCreator {
    // Member variables
    private TupleBinding mTupleBinding; // The tuple binding
    * Constructor.
    public SecondaryURLKeyCreator(TupleBinding iTupleBinding) {
    mTupleBinding = iTupleBinding;
    * Create the secondary key.
    public boolean createSecondaryKey(SecondaryDatabase iSecDB, DatabaseEntry iKeyEntry, DatabaseEntry iDataEntry, DatabaseEntry oResultEntry) {
    try {
    URLData urlData = (URLData)mTupleBinding.entryToObject(iDataEntry);
    String URL = urlData.getURL();
    oResultEntry.setData(URL.getBytes("UTF-8"));
    catch (IOException willNeverOccur) {
    // Success
    return(true);
    I think I understand what is going on, and I only noticed it now because I added more fields to my custom data (and tuple binding):
    com.sleepycat.je.Sequence.java line 139 (version 3.2.44) does this:
    status = cursor.putNoOverwrite(key, makeData());
    makeData creates a byte array of size MAX_DATA_SIZE (50 bytes) -- which has nothing to do with my custom data.
    The trigger causes an call to SecondaryDatable.updateSecondary(...) to the secondary DB.
    updateSecondary calls createSecondaryKey in my SecondaryKeyCreator, which calls entityToObject() in my tuple-binding, which calls TupleInput.readString(), etc to match my custom data. Since what is being read goes for more than the byte array of size 50, I get the exception.
    I didn't notice before because my custom tuple binding used to read fewer that 50 bytes.
    I think the problem is that my tuple binding is being invoked at all at this point -- opening a sequence -- since there is no data on which it can act.

    Hi,
    It looks like you're making a common mistake with sequences which is to store the sequence itself in a database that is also used for application data. The sequence should normally be stored in separate database to prevent configuration conflicts and actual data conflicts between the sequence record and the application records.
    I suggest that you create another database whose only purpose is to hold the sequence record. This database will contain only a single record -- the sequence. If you have more than one sequence, storing all sequences in the same database makes sense and is safe.
    The database used for storing sequences should not normally have any associated secondary databases and should not be configured for duplicates.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for