[DPL] Exception with composite SecondaryKey - Not a secondary key . . .

Can I use a composite key with a SecondaryKey annotation over Java-DPL, reference guide says that is possible but I'm having the next exception: Exception in thread "main" java.lang.IllegalArgumentException: Not a secondary key: org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida#solicitudParaAcuse*.
I defined a Persistent class DatosSSSalidaAcuse.java to help indexing information as a SecondaryKey inside SolServicioSalida.java. DatosSSSalidaAcuse.java encapsulates all attributes that I need and each one has its KeyField annotation so I don’t handle why during code execution the system throws that exception even I reviewed the class implementation for the secondary key following the same rules as for a primary key type.
Use this URL to view my class diagram:
[http://i200.photobucket.com/albums/aa90/nordlicher/Job/ClassDiagram.jpg]
Code:
LlaveSolServicio.java*
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.KeyField;
@Persistent
public class LlaveSolServicio implements Comparable <LlaveSolServicio> {
@KeyField(1)
private String numEvento;
private LlaveSolServicio() { super(); } // Requerido para deserializar.
public LlaveSolServicio(String numEvento) {
this.numEvento = numEvento;
public String obtenNumEvento() {
return numEvento;
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
if (getClass() != obj.getClass()) {
return false;
final LlaveSolServicio other = (LlaveSolServicio) obj;
if ((this.numEvento == null) ? (other.numEvento != null) : !this.numEvento.equals(other.numEvento)) {
return false;
return true;
@Override
public int hashCode() {
int hash = 7;
hash = 43 * hash + (this.numEvento != null ? this.numEvento.hashCode() : 0);
return hash;
@Override
public int compareTo(LlaveSolServicio objeto) {
int result = 0;
if (!equals(objeto)) {
result = hashCode() - objeto.hashCode();
return result;
DatosSSSalidaAcuse.java*
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.KeyField;
@Persistent
public class DatosSSSalidaAcuse implements Comparable <DatosSSSalidaAcuse> {
@KeyField(1)
private Integer idNegocio;
@KeyField(2)
private Integer idSubsistema;
@KeyField(3)
private Integer idEntidad;
@KeyField(4)
private Integer pivote;
@KeyField(5)
private Long secuencial;
@KeyField(6)
private Byte estado;
private DatosSSSalidaAcuse() { super(); } // Requerido para deserializar.
public DatosSSSalidaAcuse(Integer idNegocio, Integer idSubsistema,
Integer idEntidad, Integer pivote, Long secuencial, Byte estado) {
this.idNegocio = idNegocio;
this.idSubsistema = idSubsistema;
this.idEntidad = idEntidad;
this.pivote = pivote;
this.secuencial = secuencial;
this.estado = estado;
public Integer obtenIdNegocio() {
return this.idNegocio;
public Integer obtenIdSubsistema() {
return this.idSubsistema;
public Integer obtenIdEntidad() {
return this.idEntidad;
public Integer obtenPivote() {
return pivote;
public Long obtenSecuencial() {
return secuencial;
public Byte obtenEstado() {
return estado;
public void asignaEstado(Byte estado) {
this.estado = estado;
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
if (getClass() != obj.getClass()) {
return false;
final DatosSSSalidaAcuse other = (DatosSSSalidaAcuse) obj;
if (this.idNegocio != other.idNegocio) {
return false;
if (this.idSubsistema != other.idSubsistema) {
return false;
if (this.idEntidad != other.idEntidad) {
return false;
if (this.pivote != other.pivote && (this.pivote == null || !this.pivote.equals(other.pivote))) {
return false;
if (this.secuencial != other.secuencial && (this.secuencial == null || !this.secuencial.equals(other.secuencial))) {
return false;
if (this.estado != other.estado && (this.estado == null || !this.estado.equals(other.estado))) {
return false;
return true;
@Override
public int hashCode() {
int hash = 7;
hash = 29 * hash + this.idNegocio;
hash = 29 * hash + this.idSubsistema;
hash = 29 * hash + this.idEntidad;
hash = 29 * hash + (this.pivote != null ? this.pivote.hashCode() : 0);
hash = 29 * hash + (this.secuencial != null ? this.secuencial.hashCode() : 0);
hash = 29 * hash + (this.estado != null ? this.estado.hashCode() : 0);
return hash;
@Override
public int compareTo(DatosSSSalidaAcuse objeto) {
int resultado = 0;
if (!equals(objeto)) {
resultado = hashCode() - objeto.hashCode();
return resultado;
SolServicioSalida.java*
import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.LlaveSolServicio;
import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.SecondaryKey;
import com.sleepycat.persist.model.PrimaryKey;
import static com.sleepycat.persist.model.Relationship.MANY_TO_ONE;
import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.acuses.DatosSSSalidaAcuse;
@Entity
public class SolServicioSalida {
@PrimaryKey
private LlaveSolServicio llave;
@SecondaryKey(relate = MANY_TO_ONE)
private DatosSSSalidaAcuse llaveAcuse;
private Byte noServicio;
private Byte [] infoServ;
private SolServicioSalida() { super(); }; //Requerido para deserializar.
public SolServicioSalida(LlaveSolServicio llave,
Byte noServicio, Byte [] infoServ, Integer idNegocio,
Integer idSubsistema, Integer idEntidad, Integer pivote,
Long secuencial, Byte estado) {
this.llaveAcuse = new DatosSSSalidaAcuse(idNegocio, idSubsistema,
idEntidad, pivote, secuencial, estado);
this.llave = llave;
this.noServicio = noServicio;
this.infoServ = infoServ;
public void asignaLlave(LlaveSolServicio llave) {
this.llave = llave;
public LlaveSolServicio obtenLlave() {
return llave;
public Byte[] obtenInfoServ() {
return infoServ;
public Byte obtenNoServicio() {
return noServicio;
public DatosSSSalidaAcuse obtenLlaveSSSalidaAcuse() {
return llaveAcuse;
ColaSalida.java* _(Test class that implements main() method and storage operations)_
import com.sleepycat.persist.EntityStore;
import com.sleepycat.persist.StoreConfig;
import com.sleepycat.persist.EntityCursor;
import com.sleepycat.persist.PrimaryIndex;
import com.sleepycat.persist.SecondaryIndex;
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.Transaction;
import com.sleepycat.je.LockConflictException;
import org.banxico.dgobc.dsop.mav.foliado.persistencia.salida.configuracion.ColaSalidaConfig;
import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.LlaveSolServicio;
import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.salida.acuses.LlaveSSSalidaAcuse;
import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida;
import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.acuses.DatosSSSalidaAcuse;
import static org.banxico.dgobc.dsop.utileria.registro.AsistenteRegistrador.*;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
public class ColaSalida {
private final String nombreRepositorio = "ColaSalida";
private EntityStore repositorio;
private StoreConfig cfgRepositorio;
private PrimaryIndex<LlaveSolServicio, SolServicioSalida>
solicitudPorEvento;
private SecondaryIndex<DatosSSSalidaAcuse, LlaveSolServicio,
SolServicioSalida> solicitudParaAcuse;
private final int INTENTO_MAX_DEADLOCK = 3;
public ColaSalida(ColaSalidaConfig ambienteCfg) {
if (ambienteCfg != null) {
if (ambienteCfg.obtenAmbiente().isValid()) {
cfgRepositorio = new StoreConfig();
cfgRepositorio.setReadOnly(
ambienteCfg.obtenConfiguracion().getReadOnly());
cfgRepositorio.setAllowCreate(
!ambienteCfg.obtenConfiguracion().getReadOnly());
if (ambienteCfg.obtenConfiguracion().getTransactional()) {
cfgRepositorio.setTransactional(true);
} else {
cfgRepositorio.setTransactional(false);
try {
repositorio = new EntityStore(ambienteCfg.obtenAmbiente(),
nombreRepositorio, cfgRepositorio);
/** Primary Index de la base de objetos. **/
solicitudPorEvento = repositorio.getPrimaryIndex(
LlaveSolServicio.class, SolServicioSalida.class);
/** Secondary Index de la base de objetos. **/
solicitudParaAcuse = repositorio.getSecondaryIndex(
solicitudPorEvento,
DatosSSSalidaAcuse.class,
"solicitudParaAcuse");
} catch (DatabaseException dbe) {
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
"Ocurrio un error en la creacion de los indicies. "
+ dbe.getMessage());
System.exit(-1);
} else {
System.out.println("Ambiente de Base de Datos es null, "
+ "ejecucion fallida.");
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
"Ambiente de Base de Datos es null, ejecucion fallida.");
System.exit(-1);
public void cerrarRepositorio() {
if (repositorio != null) {
try {
repositorio.close();
} catch (DatabaseException dbe) {
System.err.println("Error cerrando el repositorio "
+ dbe.getLocalizedMessage());
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
"Error cerrando el repositorio " + dbe.getMessage());
public EntityStore obtenRepositorio() {
return this.repositorio;
public StoreConfig obtenConfigRepositorio() {
return this.cfgRepositorio;
public SolServicioSalida seleccionarPorEvento(LlaveSolServicio llave) {
if (solicitudPorEvento == null && llave == null) {
return null;
} else {
return solicitudPorEvento.get(llave);
public SolServicioSalida seleccionarParaAcuse(DatosSSSalidaAcuse llave) {
if (solicitudParaAcuse == null && llave == null) {
return null;
} else {
return solicitudParaAcuse.get(llave);
public boolean insertar(SolServicioSalida ssObj, boolean esTransaccional) {
Transaction txn = null;
boolean resultado = false;
int numIntentos = 0;
if (solicitudPorEvento != null && ssObj != null)
if (esTransaccional) {
while (numIntentos < INTENTO_MAX_DEADLOCK && !resultado) {
try {
txn = repositorio.getEnvironment().beginTransaction(
null, null);
resultado = solicitudPorEvento.putNoOverwrite(txn, ssObj);
txn.commit();
} catch (LockConflictException le) {
try {
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
"Error al bloquear campo en el repositorio "
+ le.getMessage());
if (txn != null) {
txn.abort();
txn = null;
numIntentos++;
if (numIntentos >= INTENTO_MAX_DEADLOCK
&& obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION,
ColaSalidaConfig.class,
"Limite de intentos excedido. "
+ "Deteniendo la operacion.");
} catch (DatabaseException ae) {
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION,
ColaSalidaConfig.class,
"aborto de la txn fallido: " + ae.getMessage());
} catch (DatabaseException e) {
try {
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION,
ColaSalidaConfig.class,
"Error durante ejecucion de transaccion "
+ e.getMessage());
if (txn != null) {
txn.abort();
txn = null;
} catch (DatabaseException ae) {
if (obtenerRegistrador(
Registradores.OPERACION).isInfoEnabled()) {
registrarComoInfoEn(OPERACION,
ColaSalidaConfig.class,
"aborto de la txn fallido: "
+ ae.getMessage());
} else {
resultado = solicitudPorEvento.putNoOverwrite(ssObj);
return resultado;
public EntityCursor obtenerCursorEventos() {
EntityCursor eventos = null;
if (solicitudPorEvento != null) {
eventos = solicitudPorEvento.entities();
return eventos;
public static void main (String args []) {
BasicConfigurator.configure();
Logger logger = Logger.getRootLogger();
logger.setLevel(Level.INFO);
     try {
org.banxico.dgobc.dsop.EITyS.BMcripto.BMcripto.setProvider("BC");
     } catch (Exception e) {
e.printStackTrace();
java.util.Properties propiedades = new java.util.Properties();
System.setProperty("registro.cfg", "file:"
+ ColaSalida.class.getResource("/cfg/registro.cfg").getPath());
try {
propiedades.load(new java.io.FileInputStream("./cfg/registro.cfg"));
     } catch (java.io.IOException ex) {
ex.printStackTrace();
     org.apache.log4j.PropertyConfigurator.configure(propiedades);
     registrarComoInfoEn(MONITOREO, ColaSalida.class,
     "Asistente registrador inicializado.");
ColaSalidaConfig cfg = new ColaSalidaConfig(new java.io.File("./jedb"));
ColaSalida colaSalida = new ColaSalida(cfg);
Byte [] info = {1, 0, 1, 0};
boolean resultado = false;
resultado = colaSalida.insertar(
new SolServicioSalida(
new LlaveSolServicio("abcd"),
Byte.valueOf((byte)0),
info,
new Integer(0), new Integer(0), new Integer(0),
new Integer(0),
new Long(0),
Byte.valueOf((byte)1)),
false);
registrarParaDepurarEn(NO_MONITOREO, ColaSalidaConfig.class,
"[Insercion 1]: " + resultado );
System.out.println("[Insercion 1]: " + resultado);
Edited by: AlanC. on 07.10.2010 18:00

Hello Alan,
Please post a full stack trace whenever you report a problem. Without a stack trace, I'm guessing that the exception is coming from the call below:
                    solicitudParaAcuse = repositorio.getSecondaryIndex(
                            solicitudPorEvento,
                            DatosSSSalidaAcuse.class,
                            "solicitudParaAcuse");Because the message is:
Not a secondary key: org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida#solicitudParaAcuseThe entity class is SolServicioSalida:
@Entity
public class SolServicioSalida {
  @PrimaryKey
  private LlaveSolServicio llave;
  @SecondaryKey(relate = MANY_TO_ONE)
  private DatosSSSalidaAcuse llaveAcuse;
  private Byte noServicio;
  private Byte [] infoServ;
}You're passing "solicitudParaAcuse" as the last parameter to getSecondaryIndex. This is supposed to be the field name of a field in the entity class, SolServicioSalida. But there is no such field. The only field tagged with @SecondaryKey is llaveAcuse. So don't you want to pass "llaveAcuse" as the last parameter?
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Could not insert secondary key...

    Hi Developers,
    when trying to store a key/data set, tuple bound and with a secondary db, I get this exception:
    com.sleepycat.je.DatabaseException: Could not insert secondary key in ESetsIndex OperationStatus.KEYEXIST
         at com.sleepycat.je.SecondaryDatabase.insertKey(SecondaryDatabase.java:679)
         at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.java:549)
         at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.java:43)
         at com.sleepycat.je.Database.notifyTriggers(Database.java:1158)
         at com.sleepycat.je.Cursor.putInternal(Cursor.java:723)
         at com.sleepycat.je.Database.putInternal(Database.java:532)
         at com.sleepycat.je.Database.put(Database.java:479)
    If I fill the DB without the secondary on with some Key/Data sets I can access them without any problem, even when the secondary is on.
    Only when try to put a new one in then I get this exception?
    Possibly you need the TupleBinding and KeyCreator class for your analyses:
         // Inner Class to provide the EntitySet DB TupleBinding
         private class TBinding extends TupleBinding {
              private DatExchObj esData = new DatExchObj();
              private ArrayList<String> stRec;
              private ArrayList<Long> longRec;
              // Write an EntrySet Object to the TupleOutput
              public void objectToEntry(Object obj, TupleOutput output){
                   esData = (DatExchObj)obj;
                   stRec = esData.getStRec();
                   longRec = esData.getLongRec();
                   // Set Name at the 1. Position
                   // EntityTyp Name or 'DSet' at the 2. Pos.
                   for (int i = 0; i < stRec.size(); i++)
                        output.writeString(stRec.get(i));
                   // Number of entity pointers at the 3. Pos.
                   output.writeInt(longRec.size());     
                   // Entity Pointer List
                   for (int i = 0; i < longRec.size(); i++)
                        output.writeLong((Long)longRec.get(i));
              // Read an EntrySet from the TupleInput
              public Object entryToObject(TupleInput input){
                   stRec = new ArrayList<String>();
                   longRec = new ArrayList<Long>();
                   // Set Name at index 1
                   stRec.add(input.readString());
                   // EntityTyp ID or 'DSet' at index 2
                   stRec.add(input.readString());
                   // Number of entity/property pointers to read
                   int iToRead = input.readInt();
                   // Entity Pointer List
                   for (int i = 0; i < iToRead; i++)
                        longRec.add(input.readLong());
                   esData.setStRec(stRec);
                   esData.setLongRec(longRec);
                   return esData;
         private class SecDBKC implements SecondaryKeyCreator {
              * Abstract method that we must implement.
              * Methods
              * 'createSecondaryKey'
              * Param:     SecondaryDatabase <The SecondaryDB name>
              *                DatabaseEntry <The KeyEntry>
              *                DatabaseEntry <The DataENtry>
              *                DatabaseEntry <The ResultEntry>
              private TupleBinding tB;
         public SecDBKC(TupleBinding tB) {this.tB = tB;}
         public boolean createSecondaryKey(SecondaryDatabase secDB,
         DatabaseEntry keyEntry, // From the primary
         DatabaseEntry dataEntry, // From the primary
         DatabaseEntry resultEntry) // set the key data on this.
              throws DatabaseException {
              try {
                   DatExchObj ibData = (DatExchObj) tB.entryToObject(dataEntry);
                   resultEntry.setData(ibData.getStRec().get(0).getBytes("UTF-8"));
              } catch (Exception e) { e.printStackTrace(); }
         return true;
    What is wrong?
    Thanks for any help
    Staretzek

    Hi Andrei,
    yes I let the secondary DB create with and without allowed duplicates, because the indexed value is without duplicates too.
    Here the store method blowen up for exmerimental uses:
         public long storeSet(DatExchObj esData)
              throws DatabaseException {
         /* To store an EntitySet to the setsDB BDB
         * If the key is 0, than a new entry will be performed, otherwise
         * the value of the given key will be overwritten by the given
         * new EntitySet.
         * Returns the new key, the EntitySet was written to the DB
         * or 0 if the given key was invalid.
              DatExchObj getDat;
              long lKey = esData.getLong(), l;
              if (lKey==0) {
                   //Check if a Dataset with setName exists
                   //if exists overwrite it with the new Data
                   DatExchObj checkD = getSet(esData.getStRec().get(0));
                   if (checkD!=null) lKey = checkD.getLong();
              try {
    System.out.println("storeSet lKey="+lKey);
                   DatabaseEntry obKey = new DatabaseEntry();
                   DatabaseEntry obData = new DatabaseEntry();          
                   DatabaseEntry firstData = new DatabaseEntry();          
                   OperationStatus sOPS;
                   lBind.objectToEntry(lKey, obKey);
                   // Lookup the data set at lKey
    if (true) {
                   sOPS = setsDB.get(null, obKey, obData, LockMode.DEFAULT);
    System.out.println(sOPS);
                   if (lKey == 0) { //If a new data EntitySet shell be stored..
                        if (sOPS == OperationStatus.SUCCESS) {
                             // The given EntitySet shell be stored with a
                             // new key
                             // Read the key Counter
                             getDat = (DatExchObj)tBind.entryToObject(obData);
                             l = getDat.getLongRec().get(0);
    System.out.println("Key "+lKey+"/stRec 0: "+
                                       getDat.getStRec().get(0));
    System.out.println("Key "+lKey+"/stRec 1: "+
                                       getDat.getStRec().get(1));
                             // Raise value for the next Key
                             l++;
                             getDat.getLongRec().set(0,l);
                        } else { // When there is no 0 Key entry,
                             /* than the DB is empty
                             * So, prepare the 0 Key DataSet
                             * (This entry stores the key of the
                             * latest EntitySet)
                             * Prepare the data for the 0 key DataSet
                             * Set the Key to 1 for the first entry
                             * data set
                             getDat = new DatExchObj();
                             l = 1;
                             getDat.getStRec().add("DBEntityCounter");
                             getDat.getStRec().add("Internal");
                             getDat.getLongRec().add(l);
                        } // and now prepare the key again, but as Data
    System.out.println("Key "+lKey+"/longRec 0: "+
              getDat.getLongRec().get(0));
    //if (true) return l;
                        tBind.objectToEntry(getDat, firstData);
                        obKey = new DatabaseEntry();     
                        lBind.objectToEntry(lKey, obKey);                    
                        // and write it into the DB at key 0
                        setsDB.put(null, obKey, firstData);
                        lKey = l;
                   } else // If no entry of this key exists - set lKey 0
                        if (sOPS == OperationStatus.NOTFOUND) lKey = (long)0;
    //if (true) return lKey;
                   if (lKey!=0) {
                        //Prepare the key for writing
                        obKey = new DatabaseEntry();     
                        lBind.objectToEntry(lKey, obKey);                    
                        // Prepare the entry data for writing
                        obData = new DatabaseEntry();     
                        tBind.objectToEntry(esData, obData);
                        // and write it to the DB
    System.out.println("Write set -"+esData.getStRec().get(0));
                        Transaction txn =
                             suite.getBDBEnv().getEnv().
                             beginTransaction(null,null);
                        setsDB.put(txn, obKey, obData);
                        txn.commit();
              } catch(Exception e) { e.printStackTrace(); }
              return lKey;
    Thanks for your time spending in my problems
    Regards,
    Joachim Staretzek

  • Video to TV with composite cable not working

    I bought a iPod cable that connects my iPod to a TV. When I plug it in the video usually just plays on the iPod but not the TV. Audio does play through the TV. When I play around with it by playing with the video preferences it periodically start to work. When it is working the iPod displays the title page only and the TV displays the video. When I do get it to work it only last about a minute and the the video turns off. When I turn it back on, the video goes back to displaying on the iPod only. I have the latest version IPT and OS 2.2
    Any ideas??

    It is a 3rd party supplier. My wife has the 1st generation IPT and has the same cable, but is from Apple. I will try it out later today. I will also see if her IPT works with my cable.
    I think it would be pretty strange that the manufacturer of this 3rd party cable would not try out the cable first.

  • How to build secondary keys dynamicaly in a generic entity definition class

    Hi developers,
    try to rebuild a generic entity definition class, where every instanced entity typ can has its own set of secondary fields. On the first moment it seems to be no problem, but now my problem is how to bind the annontation @Secondarykey... to the particular fields during construction of the entity shell be used?
    Hope I counld make the problem visible?
    Thanks for any help!
    ApeVeloce

    Hi Joachim,
    After understanding more about your application (off forum) I think I can answer your question more clearly. The general problem is: How can a dynamic, user defined schema be represented in Berkeley DB for multiple entity types, each with any number of properties, and arbitrary secondary keys for selected properties?
    There are many ways to do this and I'll describe one approach. I do not recommend using DPL for this case. In our documentation,
    http://www.oracle.com/technology/documentation/berkeley-db/je/PersistenceAPI/introduction.html
    we say: "Note that we recommend you use the DPL if all you want to do is make classes with a relatively static schema to be persistent." For a dynamic schema that is not represented using Java classes, the base API provides more flexibility.
    The common requirements for a dynamic schema are:
    1) Each entity has a type, which is roughly equivalent to a Java class. But unlike classes, types may be added dynamically. Queries are normally limited to entities of a particular type; this is not true for all applications, but I will make this assumption here.
    2) Each entity contains, at least logically, a Map of key-value properties. The property name is equivalent to a Java field name and the property value is equivalent to the field value. Properties may be added dynamically.
    3) Any number of properties for a given type may be defined as secondary keys. Secondary keys may be added dynamically.
    One approach for implementing this is as follows.
    A) A Database per entity type is created. This allows queries against a given type to be performed withing a single database. For simplicity the database name can be set to the name of entity type.
    The alternative is to have a single Database for all entity types. This works well for applications that want to query against properties that are common to all entity types. While such a schema is not common, it does occur; for example, an LDAP schema has this characteristic. If you do store all types in a single Database, and you want to query against a single entity type, you'll need to make the entity type a secondary key and perform a BDB "join" (see Database.join) that includes the type key.
    When queries are performed against a single type it is more efficient to have a Database per type. This avoids the extra secondary key for entity type, and the overhead of using it in each query.
    Another advantage to using a Database per type is that you can remove the entire Database in one step if the type is deleted. Calling Environment.removeDatabase is more efficient than removing the individual records.
    B) The properties for each entity can be stored as serialized key-value pairs. There are several ways to do this, but they are all roughly equivalent:
    B-1) If you use a SerialBinding, Java serialization does the work for you, but Java serialization produce larger data and is slower than using a TupleBinding.
    B-2) A TupleBinding can be implemented to write the key-value pairs. Each key is the string name. The value can also be a String, if all your data values are already Strings or if you convert values to/from Strings when they are used.
    B-3) If you have typed values (the type of each property is known) and you don't want to store values as Strings, you can write each value as a particular type in your TupleBinding. See TupleInput and TupleOutput for details.
    If your property values are not simple types (String, Integer, etc) then this approach is more complex. When using a TupleBinding, you will need custom marshaling code for each complex type. If this is too complex, then consider using a SerialBinding. Java serialization will handle arbitrary complex types, as long as each type is serializable.
    Another approach is to store each property in record of its own in a Properties database. This is a natural idea to consider, because this is what you might do with a relational database. But I do not recommend this approach because it will be inefficient to reconstruct the entire entity record from the individual property records. With BDB, we are not limited to the relational model so we can store the entire key-value map easily in a single record.
    However, this is one advantage to using a Properties database: If you commonly add or remove a single property, and entities normally have a large number of properties, and you do not commonly reconstruct the entire entity (all properties), then the Properties database approach may be more efficient. I do not think this is common, so I won't describe this approach in detail.
    C) To support any number of secondary keys, you will need to know which properties are secondary keys and you will need to implement the SecondaryKeyCreator or SecondaryMultiKeyCreator interface.
    C-1) Assuming that you have a Database per entity type, the simplest approach is to create a single SecondaryDatabase for each entity type that is associated with the primary Database for that type. The name of the SecondaryDatabase could be the name of the primary Database with a special suffix added.
    In this case, you should implement SecondaryMultiKeyCreator that returns all secondary key properties for a given entity. A two-part key should be returned for each property that is a secondary key -- {name, value} -- where name is property name and value is the value (either as a String or as a binary type using TupleInput/TupleOutput). When you perform queries for a given property, you will need to construct the {name, value} key to do the query.
    The SecondaryDatabase will need to permit duplicates (see SecondaryConfig.setSortedDuplicates) to allow any of the secondary keys to have the same value for more than one entity. If you have secondary keys that are defined to be unique (only one value per entity) then you will need to enforce that restriction yourself by performing a lookup.
    C-2) The alternative is to create a SecondaryDatabase for every property that is a secondary key. The database name could be the primary database name with a suffix identifying the secondary key.
    In this case you can implement either SecondaryKeyCreator or SecondaryMultiKeyCreator, depending on whether multiple values for each secondary key are permitted. And you can configure duplicates for the secondary database only if more than one entity may have the same secondary key value.
    Each secondary key consists only of its value, the name is not included because it is implied by the SecondaryDatabase in which it is stored. This approach is therefore more efficient than C-1 where we have a single SecondaryDatabase for all properties, because the secondary keys are smaller. However, there is the added work of maintaining the SecondaryDatabases each time the schema is changed: You must create and remove the secondary databases as the schema changes.
    For best performance, I recommend C-2.
    D) If you have a dynamic schema, you must store your metadata: the information that describes the names of each entity type, the properties allowed for that type (if restricted), and the list of which properties are secondary keys.
    I recommend storing metadata in a Database rather than in a file. This database could have a special name that cannot be used for any entity type. When metadata changes, you will be adding and removing databases. To ensure consistency, you should change the metadata and change the databases in a single transaction. This is possible only if you store the metadata in a Database.
    The Berkeley DB base API provides the flexibility to implement a dynamic schema in a very efficient manner. But be warned that implementing a data store with a dynamic schema is a complex task. As requirements grow over time, the metadata becomes more complex. You may even have to support evolution of metadata. If possible, try to keeps things as simple as possible.
    If you want complete flexibility in your schema and/or you want to store complex data types, you may want to consider storing XML. This is possible with Berkeley DB Java Edition since you can store arbitrary data in a Database, but you must implement secondary indexes for the XML data yourself -- this could be a very complex task. If you don't require pure Java, you should consider the Berkeley DB XML product. BDB XML supports many kinds of indexes as well as large documents, XPath, XQuery, and other features.
    Mark

  • Exception with the type CX_SY_OPEN_SQL_DB occured and was not handled

    Hi Champs,
    I am working on an interface which picks up file uploaded in a XI server and process it. The Function module used is a Z function module, developed locally.
    I am uploading an tab limited file in XI server and a background job processes the file. The tab limited file contains Payelement Transaction ID as primary key.  And after validation of elements like WBS element, cost center etc the file is posted using BAPI BAPI_ACC_DOCUMENT_POST. And all the Payelement Trans Ids are also replicated in a Z table, with there status viz. Success or Error or Warning.
    After background job was completed, we found in Tcode SXMB_MONI that the file was in error.
    The error message was :
    Error during proxy processing An exception with the type CX_SY_OPEN_SQL_DB occurred, but was neither handled locally, nor declared in a RAISING clause The system tried to insert a data record, even though a data record with the same primary key already exists.
    But to my dismay, I found that some of the Payelement Trans Ids were posted for a document and are also replicated in my Z table.
    From the error it seems that we are inserting a record that is already there in the document. I have checked in for BAPI's input parameter, there is nothing duplicate.
    Note: Insertion in Z table is made after the BAPI BAPI_ACC_DOCUMENT_POST.
    Can you help me out in this issue as it is now getting into veins
    Reagrds,
    Nishant

    Hi,
    Even we have faced this kind of issue. In order to solve this just write the following code:
    1) Before inserting records in to Z table, write one select query on that table with primary key fields in where clause. Pass the value that are returned by BAPI BAPI_ACC_DOCUMENT_POST to the key field.
    2) If sy-subrc = 4, insert records in Z table else Continue and dont insert records in this table. 
    This will solve your problem.
    Regards,
    Prashant

  • Imac 27" Intel Core 7 CPU. Screen goes black and will not respond except with a push of power button. Second monitor connected via displayport continues to display fine. Apply Store did full hardware scan and all is fine. Did clean wipe from Mavrick back

    Imac 27" Intel Core7  CPU 16 Gig RAM. Screen goes black and will not respond except with a push of power button. Second monitor connected via displayport continues to display fine. Apply Store did full hardware diagnostic and all is fine. Did clean wipe from Mavrick back to Mountain Lion but problem remains. Apple Store can do no more.

    I did some more digging, it appears to be a backlight problem only. I can see the screen very dimly if I use a bright flashlight in a very dark room. It also seems to run ok if the brightness is turned down a LOT.
    So I'm thinking this is a LED driver board issue or the display itself. I'll open it up and check the connection between the two and see if I can get any more clues. At least I can use it somewhat now by dimming the display significantly...

  • The full exception text is: Could not establish trust relationship for the SSL/TLS secure channel with authority :32844'.

    Hi I am getting this error,
    The Secure Store Service application Secure Store Service is not accessible
    The full exception text is: Could not establish trust relationship for the SSL/TLS secure channel with authority 'sp:32844'.
    Any help will be appreciated

    You may need to add the SSL to the SharePoint Trusted Root Authority.Get the root cert for the site you are securing with HTTPS/SSL and add in SharePoint Trusted Root Authority. As explained here -
    https://social.technet.microsoft.com/Forums/office/en-US/2aed19c6-24df-4646-b946-f4365a05e32f/secure-store-service-stops-working-once-or-twice-every-day-could-not-establish-trust-relationship?forum=sharepointadmin
    http://brainlitter.com/2012/03/13/sharepoint-2010-and-cert-trust-could-not-establish-trust-relationship-for-the-ssltls-secure-channel/
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • Exceptions with JEditorPane setPage() method (Catching not possible)

    hi all
    if anyone can help me...please help
    I got serious exceptions with the JEditorPane()'s setPage() method
    I have written the try & catch still i could not catch the exception..(those exceptions are not displaying any of my program lines)..setPage() mehod was executed properly and the page was displyed on the editorpane..and then exceptions r coming..
    --------my code--------
    java.net.URL fileurl =LongTask.class.getResource(modifiedfilename);
    editorpane.setPage(fileurl);
    ---------------------exceptions
    java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:393)
    at javax.swing.text.SimpleAttributeSet.addAttribute(SimpleAttributeSet.java:176)
    at javax.swing.text.html.CSS.translateHTMLToCSS(CSS.java:687)
    at javax.swing.text.html.StyleSheet.translateHTMLToCSS(StyleSheet.java:491)
    at javax.swing.text.html.StyleSheet$ViewAttributeSet.<init>(StyleSheet.java:2476)
    at javax.swing.text.html.StyleSheet.getViewAttributes(StyleSheet.java:312)
    at javax.swing.text.html.BlockView.getAttributes(BlockView.java:275)
    at javax.swing.text.html.StyleSheet$ViewAttributeSet.getResolveParent(StyleSheet.java:2609)
    at javax.swing.text.html.StyleSheet$ViewAttributeSet.doGetAttribute(StyleSheet.java:2589)
    at javax.swing.text.html.StyleSheet$ViewAttributeSet.getAttribute(StyleSheet.java:2569)
    at javax.swing.text.ParagraphView.setPropertiesFromAttributes(ParagraphView.java:105)
    at javax.swing.text.html.ParagraphView.setPropertiesFromAttributes(ParagraphView.java:87)
    at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:60)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.html.BlockView.setParent(BlockView.java:55)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.html.TableView$RowView.replace(TableView.java:1414)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.html.TableView.replace(TableView.java:864)
    at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
    at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
    at javax.swing.text.html.TableView.setParent(TableView.java:768)
    at javax.swing.text.CompositeView.replace(CompositeView.java:200)
    at javax.swing.text.BoxView.replace(BoxView.java:164)
    at javax.swing.text.View.updateChildren(View.java:1126)
    at javax.swing.text.View.insertUpdate(View.java:710)
    at javax.swing.text.View.forwardUpdateToView(View.java:1217)
    at javax.swing.text.View.forwardUpdate(View.java:1192)
    at javax.swing.text.BoxView.forwardUpdate(BoxView.java:222)
    at javax.swing.text.View.insertUpdate(View.java:716)
    at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1487)
    at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1726)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:184)
    at javax.swing.text.DefaultStyledDocument.insert(DefaultStyledDocument.java:201)
    at javax.swing.text.html.HTMLDocument.insert(HTMLDocument.java:232)
    at javax.swing.text.html.HTMLDocument$HTMLReader.flushBuffer(HTMLDocument.java:3254)
    at javax.swing.text.html.HTMLDocument$HTMLReader.addContent(HTMLDocument.java:3196)
    at javax.swing.text.html.HTMLDocument$HTMLReader.blockClose(HTMLDocument.java:3128)
    at javax.swing.text.html.HTMLDocument$HTMLReader$BlockAction.end(HTMLDocument.java:2334)
    at javax.swing.text.html.HTMLDocument$HTMLReader.handleEndTag(HTMLDocument.java:2233)
    at javax.swing.text.html.parser.DocumentParser.handleEndTag(DocumentParser.java:217)
    at javax.swing.text.html.parser.Parser.parse(Parser.java:2072)
    at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:106)
    at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78)
    at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:230)
    at javax.swing.JEditorPane.read(JEditorPane.java:504)
    at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:551)
    please share ideas to solve this problem

    But how can I cause GUI thread to run in my thread
    group? As I suppose GUI thread is started by JVM and
    is something separate from my code - I can get a
    reference to GUI thread but don't know how to
    manipulate or replace it...One alternative is to completely separate the GUI code from your code.
    Your code, which is wrapped in appropriate try/catch blocks, runs on its own thread and does its own processing. When it's done with that processing, it queues the results on the event thread for display. If an exception occurs during your processing, then you queue something that notifies the GUI.
    The simplest way to implement this is to spawn a new thread for each operation. The Runnable that you give to that thread looks like the following:
    public MyOperationClass implements Runnable
        public void run()
            try
                // do your exception-generating code here
                SwingUtilities.invokeLater( new MyGUIUpdateClass(param1, param2));
            catch (Exception e)
                SwingUtilities.invokeLater(new MyExceptionReporter(e));
    }This is only a bare-bones solution (and hasn't been compiled). Since it separates the GUI from actual processing, you'll probably want to display a wait cursor while the processing thread is doing its thing. You'll probably end up implementing a class that implements this pattern. You may also want to create a producer-consumer thread, so that the user won't invoke, say, a dozen different operations at once.
    However, this sort of code is absolutely essential to Swing programming. Most apps do extensive non-GUI processing, such as database queries. If you run such queries in the GUI thread, your GUI will freeze.
    Sun has named this pattern "SwingWorker", although I don't think they've fleshed it out very fully: http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

  • Inner Exception The provider is not compatible with the version of Oracle

    I am using the 64 bit ODP and Net 2.0 SDK in a C# program which runs standalone and is also hosted by another win32 process.
    When running standalone it works ok. But when being hosted by another process, I get the following exceptions thrown when i create a connection:
    INFO 2007-01-10 12:38:26,843 265ms frmCCMain LogMessage - Exception During Batch Processing1: [The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.]
    INFO 2007-01-10 12:38:26,843 265ms frmCCMain LogMessage - Inner Exception The provider is not compatible with the version of Oracle client
    I checked the DllPath value under the ODP.NET key and it points to the directory where OraOps10w.dll is installed. I also tried copying that Dll into the host process working directory and searched and found no other versions of that DLL.

    Yes, this sounds like you may be using the 9.2 client with ODP.NET and ASP.NET Providers for 11g. Usually, you can stop and start IIS to resolve this. IIS will then pick up that the 11g client directory is first in the Windows PATH, ahead of the 9.2 client directory, then use that for any subsequent Oracle client calls.

  • Error code: sec_error_untrusted_issuer, after i add the exception, get the certificate i get a blank page with big letters NOT FOUND.

    www.google.com uses an invalid security certificate.
    The certificate is not trusted because it is self-signed.
    The certificate is only valid for 78-159-121-201.local
    (Error code: sec_error_untrusted_issuer)
    After i add an exception for the site, i get this:
    Certificate Status:
    This site attempts to identif itself with invalid information.
    Wrong site:
    Certificate belongs to a diffrent site, which could indicate an identity theft.
    Unknown Identity
    Certificate is not trusted, because it hasn't been verified by a recognized authority.
    And then a blank page with big letters "Not Found"
    == URL of affected sites ==
    http://google.com , www.youtube.com , www.omegle.com , www.lockerz.com

    Do NOT add a security exception: someone is tampering with your internet connection!
    When you ask to connect to these sites using https, Firefox gets a certificate from the website which responds. Anyone can make a certificate, but to be valid the certificate must be signed by an organization which Firefox trusts.
    The person responding provided a certificate with its response which which was not signed by anybody, so Firefox doesn't know who sent the response, and neither do you.
    In short: you asked to talk to google and google did NOT send the response.
    As this is happening for several different websites, the attacker is probably on the network between your computer and the internet. Ask the people you get your internet connection for help: they may have had their computers hacked, may discover that the problem exists further along in the network, or they may even be responsible themselves.

  • GetBlobReferenceFromServerAsync (and non-async) throw an exception with 404 (not found) if the blob doesn't exist.

    I'm trying to determine if a particular file exists in a blob store. I'm using container.GetBlobReferenceFromServerAsync and if the named blob does't exist I get an exception with a 404. ICloudBlob (which is returned by the method) defines an Exists method
    but it's functionally useless because the GetBlobReferenceFromServerAsync method call itself throws the exception. I do get the behavior I'm looking for if I call container.GetBlockBlobReference instead but there's no async version of that method.

    As I said I'd found that GetBlockBlobReference works but there's no async version of that method. I'm trying to determine IF a blob exists not create one. Since the GetBlobReferenceFromServer returns an ICloudBlob and ICloudBlob defines and Exists method
    you'd assume that it could be used to determine if a blob exists. I'd argue that the fact that it throws and exception when the blob does not exist is a bug in the implementation because it makes the Exist method on the ICloudBlob object functionally useless.
    Also, it seems like a fairly significant miss that there's no async version of GetBlockBlobReference. A query to a cloud resource is exactly the perfect use case for the async/await pattern.
    Does anyone know of an async way to check for the existence of a blob that doesn't involve catching a 404 exception?

  • Composite view not working with Premiere Pro CC 2014

    I've got a user in our office who, all of a sudden, can't see any image in composite view when editing in CC 2014 - the other views work OK and he's able to generate files OK, but he can't see the actual editable image in the editor. This is a problem .
    Early '09 Mac Pro running Mac OS X 10.8.5. NVidia Quadro 4000 video card w/ latest CUDA driver (6.5.18).
    Strangely, Adobe CC (non-2014) still works OK. And the user tells me that CC 2014 WAS initially working OK but that it suddenly stopped working. I've tried a reinstall; no luck.

    Just found the answer:
    Composite Video Not Displaying on Source and Program Monitors

  • Java API, problem with secondary keys using multi key creator

    Hi,
    I'm developing an application that inserts a few 100k or so records into a Queue DB, then access them using one of four Hash SecondaryDatabases. Three of these secondary dbs use a SecondaryMultiKeyCreator to generate the keys, and one uses a SecondaryKeyCreator. As a test, I'm trying to iterate through each secondary key. When trying to iterate through the keys of any of the secondary databases that use a SecondaryMultiKeyCreator, I have problems. I'm attempting to iterate through the keys by:
    1: creating a StoredMap of the SecondaryDatabase
    2: getting a StoredKeySet from said map
    3: getting a StoredIterator on said StoredKeySet
    4: iterate
    The first call to StoredIterator.next() fails at my key binding (TupleBinding) because it is only receiving 2 bytes of data for the key, when it should be getting more, so an Exception is thrown. I suspected a problem with my SecondaryMultiKeyCreator, so I added some debug code to check the size of the DatabaseEntries it creates immediately before adding them to the results key Set. It checks out right. I also checked my key binding like so:
    1: use binding to convert the key object to a DatabaseEntry
    2: use binding to convert the created DatabaseEntry back to a key object
    3: check to see if the old object contains the same data as the new one
    Everything checked out ok.
    What it boils down to is this: my key creator is adding DatabaseEntries of the correct size to the results set, but when the keys are being read back later on, my key binding is only receiving 2 bytes of data. For the one SecondaryDatabase that doesn't use a SecondaryMultiKeyCreator, but just a SecondaryKeyCreator, there are no issues and I am able to iterate through its secondary keys as expected.
    EDIT: New discovery: if I only add ONE DatabaseEntry to the results set in my SecondaryMultiKeyCreator, I am able to iterate through the keys as I would like to.
    Any ideas or suggestions?
    Thank you for your attention,
    -Justin
    Message was edited by:
    Steamroller

    Hi Justin,
    Sorry about the delayed response here. I have created a patch that resolves the problem.
    If you apply the patch to your 4.6.21 source tree, and then rebuild Berkeley DB, the improper behavior should be resolved.
    Regards,
    Alex
    diff -rc db/db_am.c db/db_am.c
    *** db/db_am.c     Thu Jun 14 04:21:30 2007
    --- db/db_am.c     Fri Jun 13 11:20:28 2008
    *** 331,338 ****
           F_SET(dbc, DBC_TRANSIENT);
    !      switch (flags) {
    !      case DB_APPEND:
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    --- 331,337 ----
           F_SET(dbc, DBC_TRANSIENT);
    !       if (flags == DB_APPEND && LIST_FIRST(&dbp->s_secondaries) == NULL) {
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    *** 367,388 ****
    -            * Secondary indices:  since we've returned zero from an append
    -            * function, we've just put a record, and done so outside
    -            * __dbc_put.  We know we're not a secondary-- the interface
    -            * prevents puts on them--but we may be a primary.  If so,
    -            * update our secondary indices appropriately.
    -            * If the application is managing this key's data, we need a
    -            * copy of it here.  It will be freed in __db_put_pp.
    -           DB_ASSERT(dbenv, !F_ISSET(dbp, DB_AM_SECONDARY));
    -           if (LIST_FIRST(&dbp->s_secondaries) != NULL &&
    -               (ret = __dbt_usercopy(dbenv, key)) == 0)
    -                ret = __db_append_primary(dbc, key, &tdata);
                 * The append callback, if one exists, may have allocated
                 * a new tdata.data buffer.  If so, free it.
    --- 366,371 ----
    *** 390,401 ****
                /* No need for a cursor put;  we're done. */
                goto done;
    !      default:
    !           /* Fall through to normal cursor put. */
    !           break;
    !      if (ret == 0)
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    --- 373,379 ----
                /* No need for a cursor put;  we're done. */
                goto done;
    !      } else
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    diff -rc db/db_cam.c db/db_cam.c
    *** db/db_cam.c     Tue Jun  5 21:46:24 2007
    --- db/db_cam.c     Thu Jun 12 16:41:29 2008
    *** 899,905 ****
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    --- 899,905 ----
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey, tdata;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    *** 1019,1026 ****
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !      DB_ASSERT(dbenv, flags == DB_CURRENT || flags == DB_KEYFIRST ||
    !            flags == DB_KEYLAST || flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    --- 1019,1027 ----
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !       DB_ASSERT(dbenv, flags == DB_APPEND || flags == DB_CURRENT ||
    !             flags == DB_KEYFIRST || flags == DB_KEYLAST ||
    !             flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    *** 1048,1053 ****
    --- 1049,1107 ----
                     goto err;
                have_oldrec = 1; /* We've looked for the old record. */
    +      } else if (flags == DB_APPEND) {
    +           /*
    +            * With DB_APPEND, we need to do the insert to populate the
    +            * key value. So we swap the 'normal' order of updating
    +            * secondary / verifying foreign databases and inserting.
    +            *
    +            * If there is an append callback, the value stored in
    +            * data->data may be replaced and then freed.  To avoid
    +            * passing a freed pointer back to the user, just operate
    +            * on a copy of the data DBT.
    +            */
    +           tdata = *data;
    +           /*
    +            * If this cursor is going to be closed immediately, we don't
    +            * need to take precautions to clean it up on error.
    +            */
    +           if (F_ISSET(dbc_arg, DBC_TRANSIENT))
    +                dbc_n = dbc_arg;
    +           else if ((ret = __dbc_idup(dbc_arg, &dbc_n, 0)) != 0)
    +                goto err;
    +
    +           pgno = PGNO_INVALID;
    +
    +           /*
    +            * Append isn't a normal put operation;  call the appropriate
    +            * access method's append function.
    +            */
    +           switch (dbp->type) {
    +           case DB_QUEUE:
    +                if ((ret = __qam_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           case DB_RECNO:
    +                if ((ret = __ram_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           default:
    +                /* The interface should prevent this. */
    +                DB_ASSERT(dbenv,
    +                    dbp->type == DB_QUEUE || dbp->type == DB_RECNO);
    +
    +                ret = __db_ferr(dbenv, "DBC->put", 0);
    +                goto err;
    +           }
    +           /*
    +            * The append callback, if one exists, may have allocated
    +            * a new tdata.data buffer.  If so, free it.
    +            */
    +           FREE_IF_NEEDED(dbenv, &tdata);
    +           pkey.data = key->data;
    +           pkey.size = key->size;
    +           /* An append cannot be replacing an existing item. */
    +           nodel = 1;
           } else {
                /* Set pkey so we can use &pkey everywhere instead of key.  */
                pkey.data = key->data;
    *** 1400,1405 ****
    --- 1454,1465 ----
      skip_s_update:
    +       * If this is an append operation, the insert was done prior to the
    +       * secondary updates, so we are finished.
    +       */
    +      if (flags == DB_APPEND)
    +           goto done;
    +      /*
            * If we have an off-page duplicates cursor, and the operation applies
            * to it, perform the operation.  Duplicate the cursor and call the
            * underlying function.

  • BEA-000802: Could not find secondary on remote server

              I have a WebLogic cluster setup with two WebLogicServers, Admin Server and LoadBalancer
              with HttpClusterServlet.
              The first time I log into my web application I get the following error on managedServer
              1:
              ####<Jun 3, 2003 5:27:01 PM EDT> <Notice> <Cluster> <freerider1> <managedServer_1>
              <main> <<WLS Kernel>> <> <BEA-000102> <Joining cluster cluster on 237.0.0.1:7001>
              ####<Jun 3, 2003 5:27:01 PM EDT> <Notice> <WebLogicServer> <freerider1> <managedServer_1>
              <main> <<WLS Kernel>> <> <BEA-000330> <Started WebLogic Managed Server "managedServer_1"
              for domain "mydomain" running in Production Mode>
              ####<Jun 3, 2003 5:27:01 PM EDT> <Notice> <WebLogicServer> <freerider1> <managedServer_1>
              <main> <<WLS Kernel>> <> <BEA-000365> <Server state changed to RUNNING>
              ####<Jun 3, 2003 5:27:01 PM EDT> <Notice> <WebLogicServer> <freerider1> <managedServer_1>
              <main> <<WLS Kernel>> <> <BEA-000360> <Server started in RUNNING mode>
              ####<Jun 3, 2003 5:27:03 PM EDT> <Info> <WebLogicServer> <freerider1> <managedServer_1>
              <ListenThread.Default> <<WLS Kernel>> <> <BEA-000213> <Adding address: 165.218.167.197
              to licensed client list>
              ####<Jun 3, 2003 5:29:10 PM EDT> <Info> <WebLogicServer> <freerider1> <managedServer_1>
              <ListenThread.Default> <<WLS Kernel>> <> <BEA-000213> <Adding address: 165.218.167.196
              to licensed client list>
              ####<Jun 3, 2003 5:29:10 PM EDT> <Info> <HTTP> <freerider1> <managedServer_1>
              <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-101047>
              <[ServletContext(id=23107068,name=smc,context-path=/smc)] /*: init>
              ####<Jun 3, 2003 5:29:10 PM EDT> <Info> <HTTP> <freerider1> <managedServer_1>
              <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-101047>
              <[ServletContext(id=23107068,name=smc,context-path=/smc)] /*: Using standard I/O>
              ####<Jun 3, 2003 5:29:23 PM EDT> <Error> <Kernel> <freerider1> <managedServer_1>
              <ExecuteThread: '13' for queue: 'weblogic.kernel.Default'> <<WLS Kernel>> <> <BEA-000802>
              <ExecuteRequest failed
              weblogic.utils.NestedError: Could not find secondary on remote server - with
              nested exception:
              [weblogic.cluster.replication.NotFoundException: Unable to find object 823670646633126749].
              weblogic.cluster.replication.NotFoundException: Unable to find object 823670646633126749
                   at weblogic.cluster.replication.ReplicationManager.getPrimary(ReplicationManager.java:867)
                   at weblogic.cluster.replication.ReplicationManager.updateSecondary(ReplicationManager.java:712)
                   at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:486)
                   at weblogic.servlet.internal.session.ReplicatedSessionContext.sync(ReplicatedSessionContext.java:176)
                   at weblogic.servlet.internal.ServletRequestImpl.syncSession(ServletRequestImpl.java:2440)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3633)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
              --------------- nested within: ------------------
              weblogic.utils.NestedError: Could not find secondary on remote server - with nested
              exception:
              [weblogic.cluster.replication.NotFoundException: Unable to find object 823670646633126749]
                   at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:494)
                   at weblogic.servlet.internal.session.ReplicatedSessionContext.sync(ReplicatedSessionContext.java:176)
                   at weblogic.servlet.internal.ServletRequestImpl.syncSession(ServletRequestImpl.java:2440)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3633)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
              Does anybody know this problem? Any help on this greatly appreciated.
              Thanks, Marcel
              

    Hello Rozi,
              I've got the same error that you.
              Have you find out what is causing it?
              Thank you.

  • An error The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered after launching a ps1 script from cmd file.

    I'm trying to load sharepoint script from *.cmd file. 
    I have Sharepoint 2010 installed on Windows 7 x64 and SQL server 2008r2.
    My cmd file is: 
    Powershell -v 2 -NonInteractive -NoLogo -File 1.ps1
    My sharepoint file 1.ps1 is:
    $snapin="Microsoft.SharePoint.PowerShell"
    if ($action -eq $null -or $action -eq '')
    {<br />
    # Action by default is complete uninstallation.
    $action='uninstall'
    $uninstall = $true
    else
    $action = $action.ToLower()
    switch($action)
    { $_ -eq "uninstall" } { $uninstall = $true; break }
    { $_ -eq "removesolution" } { $removeSolution = $true; break }
    { $_ -eq "deactivatecorpus" } { $deactivateCorpus = $true; break }
    { $_ -eq "deactivatesupport" } { $deactivateSupport = $true; break }
    default { Write-Host -f Red "Error: Invalid action: $action "; Exit -1 }
    Check the Sharepoint snapin availability.
    if (Get-PSSnapin $snapin -ea "silentlycontinue")
    Write-Host "PS snapin $snapin is loaded."
    elseif (Get-PSSnapin $snapin -registered -ea "silentlycontinue")
    Write-Host "PS snapin $snapin is registered."
    Add-PSSnapin $snapin
    Write-Host "PS snapin $snapin is loaded."
    else
    Write-Host -f Red "Error: PS snapin $snapin is not found."
    Exit -1
    $url = "http://pc1/sites/GroupWork/"
    $site= new-Object Microsoft.SharePoint.SPSite($url )
    $loc= [System.Int32]::Parse(1033)
    $templates= $site.GetWebTemplates($loc)
    foreach ($child in $templates){ write-host $child.Name " " $child.Title}<br />
    $site.Dispose()
    The script works fine from the Sharepoint 2010 management shell after launching the shell from the start menu (or from windows cmd by entering powershell -v 2):
    PS C:\2> .\1.ps1 
    PS snapin Microsoft.SharePoint.PowerShell is loaded.
    GLOBAL#0 Global template
    STS#0 Team Site
    STS#1 Blank Site
    STS#2 Document Workspace
    MPS#0 Basic Meeting Workspace
    MPS#1 Blank Meeting Workspace
    MPS#2 Decision Meeting Workspace
    MPS#3 Social Meeting Workspace
    MPS#4 Multipage Meeting Workspace
    CENTRALADMIN#0 Central Admin Site
    WIKI#0 Wiki Site
    BLOG#0 Blog
    SGS#0 Group Work Site
    TENANTADMIN#0 Tenant Admin Site
    {248A640A-AE86-42B7-90EC-45EC8618D6B4}#MySite2 MySite2
    {95629DC2-03B1-4C92-AD70-BC1FEAA49E7D}#MySite1 MySite1
    {7F01CFE4-F5E2-408B-AC87-E186D21F624C}#NewSiteTemplate NewSiteTemplate
    PS C:\2>
    I have an access to the database Sharepoint_Config from current domain user and from other 2 users. All users have db_owner rights to the Sharepoint_Config database. But
    i've loaded in windows from the user which is dbo in the database (dbo with windows authentication with domain\username for the current user). The dbo user has do_owner rights in the Sharepoint_Config database. I've tried to login under other users and launch
    the cmd file but without success.
    My PowerShell has version 2.0: 
    PS C:\2> $psversiontable
    Name Value
    CLRVersion 2.0.50727.5477
    BuildVersion 6.1.7601.17514
    PSVersion 2.0
    WSManStackVersion 2.0
    PSCompatibleVersions {1.0, 2.0}
    SerializationVersion 1.1.0.1
    PSRemotingProtocolVersion 2.1
    After launching the script from 1.cmd file i get an errors:
    C:\2>Powershell -v 2 -NonInteractive -NoLogo -File 1.ps1
    PS snapin Microsoft.SharePoint.PowerShell is registered.
    The local farm is not accessible. Cmdlets with FeatureDependencyId are not regis
    tered.
    Could not read the XML Configuration file in the folder CONFIG\PowerShell\Regist
    ration.
    Could not find a part of the path 'C:\2\CONFIG\PowerShell\Registration'.
    No xml configuration files loaded.
    Unable to register core product cmdlets.
    Could not read the Types files in the folder CONFIG\PowerShell\types.
    Could not find a part of the path 'C:\2\CONFIG\PowerShell\types'.
    "No Types files Found."
    Could not read the Format file in the folder CONFIG\PowerShell\format.
    Could not find a part of the path 'C:\2\CONFIG\PowerShell\format'.
    No Format files Found.
    PS snapin Microsoft.SharePoint.PowerShell is loaded.
    New-Object : Exception calling ".ctor" with "1" argument(s): "The Web applicati
    on at http://Pc1/sites/GroupWork/ could not be found. Verify t
    hat you have typed the URL correctly. If the URL should be serving existing con
    tent, the system administrator may need to add a new request URL mapping to the
    intended application."
    At C:\2\1.ps1:48 char:18
    + $site= new-Object <<<< Microsoft.SharePoint.SPSite($url )
    + CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvoca
    tionException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
    Shell.Commands.NewObjectCommand
    Please help me. I don't understand why the script is launched from the sharepoint management shell but doesn't work from the cmd file.

    I have an answer for my problem:  for solving a problem I've made several steps:
    1. Run farm installation under AD admin credentials - runas /user:Domain1\DomainAdmin1 "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\psconfigui.exe".
    This user has been added as farm administrator in the wizard.
    This user has been added as DBO in the SQL Server. (This is the main difference with my previous attempts)
    2. Execute a command Add-SPShellAdmin Domain1\UserAccount1 in
    the Management Shell of Sharepoint.
    3. Run SQL server and add Sharepoint_Shell_Access to the Domain1\UserAccount1
    (my main account) in the Config database
    4. Run CMD file only from Start->Run menu. 
    runas /user:Domain1\UserAccount1 "C:\1.cmd".
    Do not use Total Commander command prompt or file list for executing *.cmd of *.bat files without root administrator account.
    Thanks all for help.

Maybe you are looking for

  • 24" Imac Horizontal Video Lines Video tearing

    My 24" Intel Imac 216 GZ Core 2 Duo 3g ram is suffering from video anomalies (thin horizontal noise lines, Tear lines and moving windows leaves trailing repeats of the window.) Lines occur as early as the desktop at startup. Using Itunes or mail aggr

  • Unable to connect  remote LDAP server 2005Q1

    To connect remote LDAP server with local mail server in iMS5.2, it was successful and very easy. But, with Sun Java Messaging 2005Q1, I failed so many times when I configure mail server. Only two things( LDAP and messaging ) are in the same machine,

  • Camera Adaptor for iPhone

    Does anyone know if there is a way to transfer digital photos from my Canon 30D and get them onto my iPhone. I want a Camera to phone connection. I know Apple made a product that allowed users to do this with the iPods but I can't find any of that in

  • HT1459 what do when you are locked out of you ipod and it says to connect to itunes

    hi i what do i do when you get locked out of your ipod and it says to connect to itunes but you have no clue what to do an itune?

  • Printer cannot print after disabling SNMP

    I need to disable SNMP for network security reasons.  After doing so from the web configuration page of my P2035N printer, network users cannot print to this printer.  It shows as 'offline', even on the web page.  We have tried restarting the printer