Key Generation in console

Hi Folks,
I have defined key generation in console .I need some information in key generation such as ,if i define None ,range and Qualifed Range.
Where it effect and what are significance of it.
Secondaly., We create clone in Import manager and then we do mapping to remote key to the clone of the main table. I am looking for the business significance and techanical signifiance of it.
Thanks in advance,
Rohit

Hi Rohit,
If you choose
NONE: - Then remote key will not be generated automatically and has to be applied explicitly either using import manager or in data manager.
RANGE: - Here we can specify a range using TO and FROM. This generates the key automatically for that client between that range.
Qualified range: - Here we specify a range for a qualified table for key generation.
Keys are generated on a per value basis i.e. MDM automatically generates keys for the specified single-valued lookup field based on values you specify
using the Range property. You can specify Qualified Range values by selecting the
single-valued lookup field from the drop-down list and specifying From
and To values for each lookup table value.
Let me know if this helped your cause.
BR,
Siddharth

Similar Messages

  • Automatic primary key generation for pointbase

    Hello friends,
    I was wondering whether it is possible to automatically generate primary keys for a pointbase database. Just like the SQL Server pointbase also has a indentity property. I have used weblogic builder to specify automatic key generation. Through the pointbase console I can see that all the columns for all the tables are marked as nullable except the primary key columns. However when I try to insert data into the database using ejb. I get the exception :
    javax.ejb.EJBException: EJB Exception:: java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    ; nested exception is: java.sql.SQLException: Data exception -- null value not allowed. .
    java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I am not sure whether I understand your question.
    The 'NamedSequenceTable' method is independent of data base type.
    <from-docs>
    Create a table named SEQUENCE to hold the current primary key value. The
    table consists of a single row with a single column, as defined by the
    following statement:
    CREATE table_name (SEQUENCE int)
    INSERT into table_name VALUES (0)
    </from-docs>
    Then, you can add the following in the DD -
    <automatic-key-generation>
    <generator-type>NamedSequenceTable</generator-type>
    <generator_name>table_name</generator-name>
    <key-cache-size>100</key-cache-size>
    </automatic-key-generation>
    The PK type should be set to java.lang.Integer or java.lang.Long
    --Sathish
    <Panduranga Swamy> wrote in message news:[email protected]..
    Hi,
    With named sequecne table,I am able to develop the application. What I
    wanted is Say Table 1 having Identity column as Primary key in the table
    Pointbase database.
    With Automatic primary key generation in Deployment descriptor, We
    generally specify SQL_SERVER or Named Sequencetable for Primary key
    generation.
    For pointbase database, I dont know how to configure this?
    Could you help me in this regard,
    Thanks,
    Pandu

  • Read "Qualified Range Key Generation" with Java API.

    Hi guru,
    I use MDM 5.5 SP6.
    In MDM Console I read Qualified Range Key Generation it in "ADMIN -> Remote Systems -> Qualified Range".
    I have to get "Qualified Range Key Generation" with Java API.
    It's possible?

    Hi Rocco,
    I am also thinking  of same scenario.I thought it is possible in Java Apis by calling the webservices for MDM.there is a service of "get key mapping" where we can pass this "Qualified key range" as  parameter.In MDM we have to define a look up table for that key ranges .We will access that table through JAVA API and then link it with the key mapping service .
    If u find any solution to apply this ,please share.
    thanks and regards
    Ank

  • Key Generation, doesnt work

    Hi, every body
    I want to generate new Material Number automatically for new Materials
    I have done the following steps
    - I have set Key Mapping to YES in Products main table
    - In the remote systems I added a new remote system called SAP_ECC
    - In this remote system I set the Key Generation to Qualified Range and set the Look Field to Material Type, also fill the Qualified Range to something like this
      [NULL]  9990000001 to 9999999999
      ZHOR   9010000001 to 9019999999
      ZVER   9020000001 to 9029999999
      ZHIB    9030000001 to 9039999999
    - In the syndicator I configured a port called TO_ECC to work with SAP_ECC remote system
    - Mapped the [Remote Key]/[Value] to MATNR field in iDOC MATMAS05
    In the Preview pane I only see Material Numbers (MATNR) which I have manually edited    its mapping value. Material Numbers are empty for new Materials.
    Please tell me. What I'm missing?

    Hi Rafael
    In my experience with Key Generation, the keys are only created for the remote system  once a Syndication job has actually processed the record. I'd guess that this is so in order to minimise the amount of work done by the MDM Server and to avoid "wasting" keys.
    To see that it does work : execute the Syndication job then refresh the Record view (press F5) in the Syndicator. The Destination Preview tab should now contain the newly generated key.
    HTH,
    Mark

  • Key generation in Remote Systems.

    Hi,
       When we are creating a remote Sytem we have a filed called Key Generation , where we can specify the from , to Range.
    Can any one provide me the business scenario where this key generation is used?
              I have an idea about key mapping which is used to differentiate filed values which are different in connected remote systems.
    regards,
    Venki.

    Hi Venki,
    The key generation is a very useful concept.
    For Key Generation = Range, From=100, To= 200:
    You need to map the Remote key to MDM_Material field during syndication in which you want to maintain the value.
    So the first time you syndicate data, 100 will be assigned to the MDM_Material field for the syndicated record.. so on..
    It gets updated to your field only after syndication and you can see it on edit key mapping against the record.
    For Key Generation with Qualified range:
    You need to select the lookup table, based on whose values you want value to be maintained in MDM_Material.
    And for each value in the lookup field, you can select the range.
    Example: Assigning Material number based on Account Groups.
    Hope it help.
    Thanks,
    Priti
    Edited by: Priti Rani Patnaik on Apr 7, 2010 10:23 AM

  • Primary key generation: Using CounterHome?

    I can't find any documentation that talks about automatic primary key generation support on OC4J. I noticed the article on the Orion Support page that mentions their "Counter" bean. Is this the extent of support for automatic primary key generation in OC4J? When I searched for this class in the distribution, I only found it in a demo application in JDeveloper.
    Is this something that is handled directly in the Oracle DB, which is why OC4J doesn't bother to support it?

    Sorry I wasn't specific. By "going nowhere", I meant it went to an error page on the orion site. I don't know why it couldn't find it, because when I just now searched for the article with the title you just gave, the resulting URL was identical to what you gave me originally.
    As to the "counter faq", I think I've seen that before, but I can't get to it right now (server overloaded or something). The one problem I remember with trying to pursue the "counter" solution was somewhat simple. I couldn't find the code. I didn't notice a download for the "Counter" class, and I can't find it in either the jdeveloper or oc4j distributions.
    In any case, I ended up implementing the UUID solution, based on Floyd Marinescu's example in "EJB Design Patterns". I think this will work fine for our application.
    I'd still like to know more about Orion's "Counter" solution, if there's any real code available to see.

  • Primary key generation

    How do use primary keys generated by database within entity bean?

    DBMS primary key generation uses a set of deployment descriptors that
    are specified at compile time to generate container code which is used
    in conjunction with a supported database to provide key generation
    support. Specify the name of the supported DBMS and the generator name,
    if required by the database. Generated primary key support for Oracle
    databases use Oracle's SEQUENCE. Once the SEQUENCE already exists in the
    database, you specify automatic key generation in the XML deployment
    descriptors. In the weblogic-cmp-rdbms-jar.xml file
    <automatic-key-generation>
    <generator-type>ORACLE</generator-type>
    <generator_name>test_sequence</generator-name>
    <key-cache-size>10</key-cache-size>
    </automatic-key-generator>
    You need to specify the name of the ORACLE SEQUENCE to be used in the
    generator-name element. If the ORACLE SEQUENCE was created with an
    INCREMENT value, then you must specify a key-cache-size. This value must
    match the Oracle SEQUENCE INCREMENT value.
    Owen wrote:
    How do use primary keys generated by database within entity bean?

  • ADF BC Primary key generation with SQL Server DB

    Hi,
    I am using ADF 11.1.1.6 to develop a small application that will do some very basic CRUD operations on a SQL Server DB.
    I read through http://www.oracle.com/technetwork/developer-tools/jdev/multidatabaseapp-085183.html before I'm starting to implement the Entity objects.
    This document describes a way to do primary key generation using a table created in the DB and instructs to create an application connection to the Database :
    +2. Create a Connection to the Table+
    In your application, create a database connection named ROWIDAM_DB that points to the database containing your S_ROW_ID table. Alternatively, edit your BC project's properties and add the following Java option to the project's run configuration:
    -Djbo.rowid_am_conn_name= appconnection
    where appconnection is the name of a database connection that points to the S_ROW_ID table.
    My question is how do we do this when we mve to a production environment ?
    Also I'll be interested to hear if anyone has any pointers for developing ADF apps with SQL Server. (gotchas, performance pitfalls etc. )
    -Jeevan
    Upadte : This is SQL Server 2005
    Edited by: Jeevan Joseph on May 2, 2012 9:04 AM

    my apologies to everyone ... This should have been very simple. I just need to provide the config in my AM configuration(bc4j.xml)
    jbo.rowid_am_conn_name* should be set to the connection name you create. For production deployments, theres a similar
    jbo.rowid_am_datasource_name* that should work just fine (though I havent tried if it has any hiccups).
    I'd like to point out one thing though, for whoever might stumble upon this thread and find it useful later on...
    After I did the steps above, everything seemed to work when I tested the app from the AM tester. But when I built a UI for it in ADF Faces, I started getting an exception on Create/CreateInsert :
    java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to oracle.jdbc.OracleConnection
         at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:5533)
         at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5311)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1194)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6826)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:213)The trouble is that the ADF Faces adf-config.xml overrides the AM configuration. Oracle is the default, and it overrides the SQL flavor I set when initializing the Model project.
    This was not mentioned in the original document probably because ADF faces was out of scope for that document.
    I also found this thread extremely useful, and its what reminded me of the ADF Faces AM config overrides : Re: Locking mode 'optupdate' with SQL92
    Cheers !
    Jeevan

  • Problem with automatic key generation

    Hi,
    I'm getting an exception when creating entity EJB's that use automatic primary key
    generation (I'm using MS SQL Server as the db). The data is being inserted correctly
    onto the database (including the auto generated key), but the auto generated primary
    key field in the EJB is being set to zero rather than the correct value. This causes
    a NoSuchEntityException.
    The db table has an identity set on the auto generated field, but this field is not
    the primary key.
    Does anyone have an idea as to what the problem is?
    thanks,
    Andy

    Make sure you are using a TX DataSource
    "Andy Pearson" <[email protected]> wrote in message
    news:3ccead40$[email protected]..
    >
    Hi,
    I'm getting an exception when creating entity EJB's that use automaticprimary key
    generation (I'm using MS SQL Server as the db). The data is being insertedcorrectly
    onto the database (including the auto generated key), but the autogenerated primary
    key field in the EJB is being set to zero rather than the correct value.This causes
    a NoSuchEntityException.
    The db table has an identity set on the auto generated field, but thisfield is not
    the primary key.
    Does anyone have an idea as to what the problem is?
    thanks,
    Andy

  • Data Quality Manager component Crashing during Batch Key Generation?

    Hi All,
    I have setup batch key generation for "FINS Members" buscomp and when the job is executed the task crashes always. I have observed the crash is not consistent on a particular data.
    Most of the times we get FDR file generated and sometimes we have another file "hs_err_pid xxx.log" in the siebel server BIN directory.
    When batch is executing one specific record it seems to be running out of memory.
    Below is the detail from the crash log:-
    Virtual memory info:
      Total              : 2097024 KB
      Available          : 1122452 KB
      Available extendent: 0 KB
    Few Crash Scenario 's:-
    Crash Scenarios:
    73 Contacts - DqMgr CRASH while processing the record "1-908F9". After removing the record from the system, batch job completed with no crash. The contact record has two address associated with this and the name details are below:
    Last Name - ER11 PASS 3 LN
    First Name - ER11 PASS 3 FN
    Middle Name - ER11 PASS 3 MN
    Two Address Associated
    689 contacts DqMgr CRASH while processing the record "1-6KRHD". After removing the record from the system, batch job completed with no crash. The contact record has one address associated with this and the name details are below:
    Last Name - UAT TESTING
    First Name - SCENARIO 6 CLIENT
    Middle Name - DO NOT USE
    One Address Associated
    Any help?
    Thanks.

    Hi
    Thanks for using My Oracle Support Community.
    You mention - "After removing the record from the system, batch job completed with no crash"
    I would recommend you to  check the record and if there are any differences between this record and the others for which the process gets completed.
    Also, please raise a Service Request with Oracle Tech Support with all the relevant logs so that we can analyse the issue in detail and suggest you further recommendations.
    Thanks,
    Shwet

  • Error after transport:'Foriegn key generation error'

    Hi ,
    Iam getting the below error at transport in quality
    Foreign key generation error for field 'ZZEVV_FR_KONX-KNUMH'
    Thanks
    Edited by: chidambar dixit on Jul 25, 2008 8:25 AM
    Edited by: chidambar dixit on Jul 25, 2008 8:26 AM

    HI,
    Then check the error log carefully. Problem might be some else. If not try to reimport the transport with the help of BASIS.
    Also check the status of check table in quality. Is it active?
    All ur objects are in single TR? If not the u have to move check table TR first and then later objects TR.
    If nothing works then include all the objects in another TR and transport. make sure all are active.
    Thanks,
    Vinod.

  • Urgent: automatic key generation and java.lang.Long

    Hi,
    I keep getting the following error:
    In RDBMS CMP bean 'UserEntity', when Automatic Key Generation is enabled, the
    Primary Key class must be java.lang.Integer.
    I need to have Long as primary key, how do I solve it?
    Thanks,
    A.

    Use WebLogic Server 8.1
    java.lang.Long is supported in WLS 8.1
    thanks,
    Deepak
    "iggy" <[email protected]> wrote:
    >
    Hi,
    I keep getting the following error:
    In RDBMS CMP bean 'UserEntity', when Automatic Key Generation is enabled,
    the
    Primary Key class must be java.lang.Integer.
    I need to have Long as primary key, how do I solve it?
    Thanks,
    A.

  • Cluster DuplicateKeyExecption and primary key generation

    Hi
    I have 2 applications servers working in a cluster.
    I'm using for primary key generation The pattern "sequence blocks" taken from the book ejb design patterns.
    However when i have something like 5 threads that are trying to create new entities then i get DuplikateKeyException on the primary key. (with only 1 jboss server not in a cluster everything is fine).
    I was wondering if anybody could help me pin out the problem, following is my code:
    I estimated it might be an Isolation level problem, however i have updated the isolation level to be serializable in that way in mysql ds and the problem still happend...
    Code:
    <user-name>root</user-name>
    <password></password>
    <TransactionIsolation>TRANSACTION_SERIALIZABLE</TransactionIsolation>
    Sequence entity bean
    Code:
    import javax.ejb.*;
    abstract public class SequenceBean implements EntityBean {
    EntityContext entityContext;
    public java.lang.String ejbCreate(java.lang.String name) throws CreateException {
    setName(name);
    return null;
    public void ejbPostCreate(java.lang.String name) throws CreateException {
    setSIndex(ConfigContainer.getJMXPropertiesFacade().getSequenceSessionBeanStartIndex());
    public void ejbRemove() throws RemoveException {
    public abstract void setName(java.lang.String name);
    public abstract void setSIndex(int sIndex);
    public abstract java.lang.String getName();
    public abstract int getSIndex();
    public void ejbLoad() {
    public void ejbStore() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void unsetEntityContext() {
    this.entityContext = null;
    public void setEntityContext(EntityContext entityContext) {
    this.entityContext = entityContext;
    public int getValueAfterIncrementingBy(int blockSize) {
    this.setSIndex(this.getSIndex()+ blockSize);
    return this.getSIndex();
    sequence session bean
    Code:
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import org.apache.log4j.Category;
    public class SequenceSessionBean implements SessionBean {
    SessionContext sessionContext;
    private Category _log;
    private class Entry {
    Sequence sequence;
    int last;
    private java.util.HashMap _entries = new java.util.HashMap();
    private int _blockSize;
    private int _retryCount;
    private SequenceHome _sequenceHome;
    public void ejbCreate() throws CreateException {
    _log = Category.getInstance(getClass());
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
    Context namingContext = null;
    try {
    namingContext = new javax.naming.InitialContext();
    _blockSize = JMXPropertiesFacade.getInstance().getSequenceSessionBeanBlockSize();
    _retryCount = JMXPropertiesFacade.getInstance().getSequenceSessionBeanRetryCount();
    _sequenceHome = (SequenceHome) namingContext.lookup("SequenceLocalHome");
    catch (NamingException e) {
    _log.error(e.getMessage(), e);
    public void synch() throws InternalException {
    Connection connection = null;
    ResultSet resultSet = null;
    Statement statement = null;
    int maxObjectID = 0, maxUID = 0, maxShareID = 0;
    try {
    connection = MASConnectionManager.getInstance().createConnection();
    String sql = "select max(" + AlbumElementHome.FIELD_NAME_OBJECT_ID + ") maxObjectID from " + AlbumElementHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxObjectID = resultSet.getInt("maxObjectID");
    _log.debug(String.valueOf(maxObjectID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementHome.JNDINAME)).setSIndex(maxObjectID
    + 1);
    sql = "select max(" + UserHome.FIELD_UID + ") maxUID from " + UserHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxUID = resultSet.getInt("maxUID");
    _log.debug(String.valueOf(maxUID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(UserHome.JNDINAME)).setSIndex(maxUID + 1);
    sql = "select max(" + AlbumElementShareHome.FIELD_SHARE_ID + ") maxShareID from " + AlbumElementShareHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxShareID = resultSet.getInt("maxShareID");
    _log.debug(String.valueOf(maxShareID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementShareHome.JNDINAME)).setSIndex(maxShar
    eID + 1);
    } catch (SQLException e1) {
    _log.error(e1.getMessage(), e1);
    } catch (FinderException e) {
    throw new InternalException(e);
    } finally {
         try {
         if (connection != null && !connection.isClosed()) connection.close();
         } catch (SQLException e) {
         _log.error(e.getMessage(), e);
    public int getNextSequenceNumber(String name) {
    try
    Entry entry = (Entry) _entries.get(name);
    if (entry == null)
    // add an entry to the sequence table
    entry = new Entry();
    try
    entry.sequence = _sequenceHome.findByPrimaryKey(name);
    catch (javax.ejb.FinderException e)
    _log.info("can't find sequence: " + name + " trying to create it");
    // if we couldn't find it, then create it...
    entry.sequence = _sequenceHome.create(name);
    _log.info("sequence: " + name + " created");
    _entries.put(name, entry);
    if (entry.last % _blockSize == 0)
    for (int retry = 0; true; retry++)
    try
    entry.last = entry.sequence.getValueAfterIncrementingBy(_blockSize);
    break;
    catch (javax.ejb.TransactionRolledbackLocalException e)
    if (retry < _retryCount)
    // we hit a concurrency exception, so try again...
    _log.info("RETRYING");
    continue;
    else
    // we tried too many times, so fail...
    throw new javax.ejb.EJBException(e);
    return entry.last++;
    catch (javax.ejb.CreateException e)
    throw new javax.ejb.EJBException(e);
    from ejb-jar.xml
    Code:
    <container-transaction>
    <method>
    <description />
    <ejb-name>SequenceSession</ejb-name>
    <method-name>getNextSequenceNumber</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    jboss.xml
    Code:
    <container-configurations>
    <container-configuration>
    <container-name>Standard CMP 2.x EntityBean with cache invalidation</container-name>
              <commit-option>A</commit-option>
              <cache-invalidation>True</cache-invalidation>
    </container-configuration>
    </container-configurations>
    <entity>
    <ejb-name>Sequence</ejb-name>
    <local-jndi-name>SequenceLocalHome</local-jndi-name>
    <!-- no cache for this entity bean -->
    </entity>
    anybody can help with what the problem might be?
    did i update the isolation level correctly?

    _blocksize may be returning 0                                                                                                                                                                                                                                   

  • Help Primary Key generation

    According to article "Generating Primary Key Values in CMP Beans" (http://www.netbeans.org/kb/41/generated-primary-keys.html) you can specifiy automatic primary key generation.
    The following fragment describes a key issue when you have a existing database schema.
    If the database schema is not created during deployment, the primary key column in the mapped table must be of type NUMERIC with a precision of 19 or more, and must not be mapped to any CMP field. The Sun Java System Application Server generates unique values for the primary key column at runtime.
    In the used sample for how to set up a MySql database the creation of the customer table must be as follows:
    CREATE TABLE customer (
    id BIGINT(19) NOT NULL auto_increment, -- this column will be automat. generated
    lastName varchar(25) NOT NULL,
    firstName varchar(30) default NULL,
    PRIMARY KEY (id));
    My question is:
    Is it nescesary to have the field id to be decleared auto incremented?
    The first fragment says that the AS will create new values for the primary key. Or does the generation of primary keys only work if the pk field in the database table is auto incremented by the database?
    Please help. Thanks!
    Johan.

    Hello Johan,
    no, as i remember it does not work if you specify the id column as auto_increment. The J2EE bean container does manage the generation of the primary key, so the database must have a column type int(19) or bigint and primary key, not more.
    Hope this helps, more information is in the J2EE documentation from Sun, page 1012.
    Kind regards,
    marc.

  • Marinescu Primary Key Generation

    Hi
    i'm using Marinescus Primary Key Generation schema, but i'm having a problem
    As i see it in EJB Design Patterns (Marinescus Book), he uses a Hashtable to store the values so that the Bean doesn't have to access the database everytime
    My problem is that this Hashtable is not working, because each client when access the Bean, this creates a new bean (just like in the pattern) and thus there is never info on the Hashtable, thus the application has to go to the Database.
    If i put the Hashtable as static, i will have Concurrency Problems
    But my real problem is that i've seen various implementations of this pattern, and no one seems to talk about this problem
    Am i missing something ?
    I've thought maybe Marinescus uses only one static SessionBean (resolving the problem), but he create one Bean for each request also
    Thanks

    So, i found the problem
    I had the SessionBean configured as a Stateful Session Bean
    But if i change it to Stateless it starts working
    I still didn't figured out why (as no Load, Store, Passivation or Activation code exists to keep or get the Hashtable)
    So if any one could explain it to me, it would be nice :)
    Thanks

Maybe you are looking for

  • TV shows and podcast for Zen microph

    My son had to get the Zen microphoto. He couldn't be like my girls and get the apple photo. He claims Zen is so much better. How /where do I go to get tv shows and 'video' podcast for the microphoto The girls have tons in their itunes account. I gues

  • Property to set hex/binary/decimal format at run time?

    Hi, I'd like to allow my user to choose between hex/binary/decimal formats in his number input. I'm happy to do the radio button stuff and the code to "hear" what he wants, but I can't find a property of my variable which selects the format at run-ti

  • Change request message standards

    Hi Experts,     what is the change request message standards? Is there any message standards. Pls send me the full details. Thanks in Advance, Saradhi

  • Viewing itemised call details - service downgraded

    Many customers wish to be able to view call details. Sometimes it is to check which kids are spending a fortune phoning friends on mobiles, or getting suckered into dialling premium rate numbers, sometimes it is to provide proof that a call was made

  • How can I download photos from my Blackberry Storm onto my iMac?

    I have tried downloading Pocket Mac and a few other things that do not work. Thanks