Put failure behavior in a non-transactional db?

Hi all,
I'm still getting to know the ropes here, so hopefully this isn't a stupid question. I'm still prototyping an application, and as such I haven't set my database to be transactional (learning one thing at a time). The app runs for quite a while, but eventually it tries to put an entity into a primary index that violates one of the secondary key constraints (uniqueness). The put() call throws an exception (properly showing KEYEXIST) but then all subsequent operations that I try to perform fail with a lock timeout (DeadlockException).
My guess is that some resource wasn't cleaned up after the exception since I'm not running transactionally (so no auto-commit), but I can't find any documentation to back that up. Am I likely to avoid this problem if I turn on transactions? If I don't, is there something in the API I can do to clean up after an exception in a non-transactional put?
Thanks!
Jeff Alexander

You may want to check to make sure that you're not leaving a cursor open when an exception occurs. An open cursor will hold a lock. I recommend closing cursors in a finally block.
If a lock is held by mistake (either your mistake such as not closing a cursor, or a bug in JE), a deadlock may not be caused immediately because other operations may not need to lock the same record. To debug this, perhaps after receiving the KEYEXIST exception and closing cursors properly, you could try closing all Databases and the Environment. Environment.close will throw an exception if any locks were not released.
It would be nice if there were a way to query the number of outstanding locks, but I don't think we have a way to do that currently, without reaching into JE internals.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Non-transactional cursor writes block reads

    I'm opening a cursor without using a transaction like so:
    CursorConfig conf = new CursorConfig();
    Cursor cursor = db.openCursor(null, conf);
    I then iterate over the items, sometimes replacing a value. I want to be able to read (and maybe write) to any value from another thread while the cursor is still open, but gets result in the following error:
    com.sleepycat.je.DeadlockException: (JE 3.3.74) Lock expired. Locker 32098350 -1_NioProcessor-3_ThreadLocker: waited for lock on database=settings LockAddr:1537969 node=2623139 type=READ grant=WAIT_NEW timeoutMillis=500 startTime=1229438453225 endTime=1229438453730
    Owners: [<LockInfo locker="11743647 -1_NioProcessor-1_ThreadLocker" type="WRITE"/>]
    Waiters: []
    I would have expected that outside a transaction any update made through a cursor would be applied immediately, but instead the record is locked until the cursor is closed. This happens whether or not je.env.isTransactional is set to true.
    Setting je.env.isLocking to false gives me the cursor behaviour that I want, but I'm not sure what else is affected by this setting, and the javadoc comment is just vaguely worrying rather than helpful ("This property should be set to false only in special circumstances when it is safe to run without record locking.")
    I am not planning on using any transactions in this application.

    Cormac,
    I was looking through the documentation for a reference page to direct you to, and I realized that probably the clearest explanation in the javadoc is in the com.sleepycat.je.LockMode page here: [http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/LockMode.html]. There is a reference to it from the CursorConfig page, but I can see that the link between the two pages is not that clear.
    From the LockMode javadoc, there is this paragraph.
    bq. Locking Rules \\ Together with CursorConfig, TransactionConfig and EnvironmentConfig settings, lock mode parameters determine how records are \\ locked during read operations. Record locking is used to enforce the \\ isolation modes that are configured. Record locking is summarized below for \\ read and write operations. For more information on isolation levels and \\ transactions, see [Writing Transactional Applications|http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/index.html]. \\ With one exception, a record lock is always acquired when a record is \\ read or written, and a cursor will always hold the lock as long as it is \\ positioned on the record. The exception is when [READ_UNCOMMITTED|http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/LockMode.html#READ_UNCOMMITTED] \\ is specified, which allows a record to be read without any locking.
    Transactional cursors, by default, hold all locks until the cursor is closed. In your case, you are using a non transactional cursor, and locks are not collected the same way. But a lock for modified record is still taken in a non transactional cursor, and is held as long as the cursor is positioned at that record, to provide cursor stability. I am guessing that is what is happening in your case. If you close the cursor or move to a different position, you will be releasing the lock.
    In a second posting, you comment on your experiences using the je.env.locking property. That property is really only to be used in cases where the application is very constrained and has high performance requirements; frankly, that was put in for a particular set of power users and we really don't recommend it for general purpose use. (We should doc it better too). One characteristic is that it disables log cleaning, because the lack of locks makes it impossible for us to properly coordinate access to the data from the log cleaning threads.
    Regards,
    Linda
    Edited by: Linda Lee on Dec 16, 2008 2:19 PM (changed " link between the two pages is that clear" -> not that clear)

  • NON-transactional session bean access entity bean

    We are currently profiling our product using Borland OptmizeIt tool, and we
    found some interesting issues. Due to our design, we have many session beans which
    are non transactional, and these session beans will access entity beans to do
    the reading operations, such as getWeight, getRate, since it's read only, there
    is no need to do transaction commit stuff which really takes time, this could
    be seen through the profile. I know weblogic support readonly entity bean, but
    it seems that it only has benefit on ejbLoad call, my test program shows that
    weblogic still creates local transaction even I specified it as transaction not
    supported, and Transaction.commit() will always be called in postInvoke(), from
    the profile, we got that for a single method call, such as getRate(), 80% time
    spent on postInvoke(), any suggestion on this? BTW, most of our entity beans are
    using Exclusive lock, that's the reason that we use non-transactional session
    bean to avoid dead lock problem.
    Thanks

    Slava,
    Thanks for the link, actually I read it before, and following is what I extracted
    it from the doc:
    <weblogic-doc>
    Do not set db-is-shared to "false" if you set the entity bean's concurrency
    strategy to the "Database" option. If you do, WebLogic Server will ignore the
    db-is-shared setting.
    </weblogic-doc>
    Thanks
    "Slava Imeshev" <[email protected]> wrote:
    Hi Jinsong,
    You may want to read this to get more detailed explanation
    on db-is-shared (cache-between-transactions for 7.0):
    http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1127563
    Let me know if you have any questions.
    Regards,
    Slava Imeshev
    "Jinsong HU" <[email protected]> wrote in message
    news:[email protected]...
    Thanks.
    But it's still not clear to me in db-is-shared setting, if I specifiedentity
    lock as database lock, I assumed db-is-shared is useless, because foreach
    new
    transaction, entity bean will reload data anyway. Correct me if I amwrong.
    Jinsong
    "Slava Imeshev" <[email protected]> wrote:
    Jinsong,
    See my answers inline.
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    Hi Slava,
    Thanks for your reply, actually, I agree with you, we need to
    review
    our db
    schema and seperate business logic to avoid db lock. I can not say,guys,
    we need
    to change this and that, since it's a big application and developedsince
    EJB1.0
    spec, I think they are afraid to do such a big change.Total rewrite is the worst thing that can happen to an app. The
    better aproach would be identifying the most critical piece and
    make a surgery on it.
    Following are questions in my mind:
    (1) I think there should be many companies using weblogic serverto
    develop
    large enterprise applications, I am just wondering what's the maintransaction/lock
    mechanism that is used? Transional session / database lock,
    db-is-shared
    entity
    I can't say for the whole community, as for my experience the standard
    usage patthern is session fasades calling Entity EJBs while having
    Required TX attribute plus plain transacted JDBC calls for bulk
    reads or inserts.
    is the dominant one? It seems that if you speficy database lock,
    the
    db-is-shared
    should be true, right?Basically it's not true. One will need db-is-shared only if thereare
    changes
    to the database done from outside of the app server.
    (2) For RO bean, if I specify read-idle-timeout to 0, it shouldonly
    load
    once at the first use time, right?I assume read-timeout-seconds was meant. That's right, but if
    an application constantly reads new RO data, RO beans will be
    constantly dropped from cache and new ones will be loaded.
    You may want to looks at server console to see if there's a lot
    of passivation for RO beans.
    (3) For clustering part, have anyone use it in real enterpriseapplication?
    My concern, since database lock is the only way to choose, how aboutthe
    affect
    of ejbLoad to performance, since most transactions are short live,if high
    volume
    transactions are in processing, I am just scared to death about
    the
    ejbLoad overhead.
    ejbLoad is a part of bean's lifecycle, how would you be scared ofit?
    If ejbLoads take too much time, it could be a good idea to profile
    used SQLs. Right index optimization can make huge difference.
    Also you may want cosider using CMP beans to let weblogic
    take care about load optimization.
    (4) If using Optimization lock, all the ejbStore need to do
    version
    check
    or timestamp check, right? How about this overhead?As for optimistic concurrency, it performs quite well as you can
    use lighter isolation levels.
    HTH,
    Slava Imeshev
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    We are using Exclusive Lock for entity bean, because of we do
    not
    want
    to
    load
    data in each new transaction. If we use Database lock, that means
    we
    dedicate
    data access calls to database, if database deadlock happens,
    it's
    hard
    to
    detect,
    while using Exclusive lock, we could detect this dead lock in
    container
    level.
    The problem is, using Exclusive concurrency mode you serialize
    access to data represented by the bean. This aproach has negative
    effect on ablity of application to process concurrent requests.As
    a
    result the app may have performance problems under load.
    Actually, at the beginnning, we did use database lock and usingtransactional
    The fact that you had database deadlocking issues tells that
    application logic / database schema may need some review.
    Normally to avoid deadlocking it's good to group database
    operations mixing in updattes and inserts into one place so
    that db locking sequence is not spreaded in time. Moving to
    forced serialized data access just hides design/implementation
    problems.
    session bean, but the database dead lock and frequent ejbLoad
    really
    kill
    us,
    so we decided to move to use Exclusive lock and to avoid dead
    lock,
    we
    change
    some session bean to non-transactional.Making session beans non-transactions makes container
    creating short-living transactions for each call to entity bean
    methods. It's a costly process and it puts additional load to
    both container and database.
    We could use ReadOnly lock for some entity beans, but since weblogicserver will
    always create local transaction for entity bean, and we found
    transaction
    commit
    is expensive, I am arguing why do we need create container leveltransaction for
    read only bean.First, read-only beans still need to load data. Also, you may seeRO
    beans
    contanly loading data if db-is-shared set to true. Other reason
    can
    be
    that
    RO semantics is not applicable the data presented by RO bean (forinstance,
    you have a reporting engine that constantly produces "RO" data,
    while
    application-consumer of that data retrieves only new data and neverasks
    for "old" data). RO beans are good when there is a relatively stable
    data
    accessed repeatedly for read only access.
    You may want to tell us more about your app, we may be of help.
    Regards,
    Slava Imeshev
    I will post the performance data, let's see how costful
    transaction.commit
    is.
    "Cameron Purdy" <[email protected]> wrote:
    We are currently profiling our product using Borland
    OptmizeIt
    tool,
    and we
    found some interesting issues. Due to our design, we have
    many
    session
    beans which
    are non transactional, and these session beans will access
    entity
    beans
    to
    do
    the reading operations, such as getWeight, getRate, since
    it's
    read
    only,
    there
    is no need to do transaction commit stuff which really takes
    time,
    this
    could
    be seen through the profile. I know weblogic support readonly
    entity
    bean,
    but
    it seems that it only has benefit on ejbLoad call, my test
    program
    shows
    that
    weblogic still creates local transaction even I specified
    it
    as
    transaction not
    supported, and Transaction.commit() will always be called
    in
    postInvoke(),
    from
    the profile, we got that for a single method call, such as
    getRate(),
    80%
    time
    spent on postInvoke(), any suggestion on this? BTW, most of
    our
    entity
    beans are
    using Exclusive lock, that's the reason that we use
    non-transactional
    session
    bean to avoid dead lock problem.I am worried that you have made some decisions based on an improper
    understand of what WebLogic is doing.
    First, you say "non transactional", but from your description
    you
    should
    have those marked as tx REQUIRED to avoid multiple transactions
    (since
    non-transactional just means that the database operation becomesits
    own
    little transaction).
    Second, you say you are using exclusive lock, which you shouldonly
    use
    if
    you are absolutely sure that you need it, (and note that it
    does
    not
    work in
    a cluster).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    >

  • [Solved] if(Transaction specified for a non-transactional database) then

    I am getting started with BDBXML 2.4.14 transactions and XQuery update functionality and I am having some difficulty with 'node insert ...' and transactions failing with 'Transaction specified for a non-transactional database'
    Thanks for helping out.
    Setup:
    I have coded up a singleton manager for the XmlManger with a ThreadLocal holding the transaction and a query method to execute XQueries. The setup goes like this:
    environmentConfig = new EnvironmentConfig();
    environmentConfig.setRunRecovery(true);               environmentConfig.setTransactional(true);               environmentConfig.setAllowCreate(true);               environmentConfig.setRunRecovery(true);               environmentConfig.setInitializeCache(true);                environmentConfig.setTxnMaxActive(0);               environmentConfig.setInitializeLocking(true);               environmentConfig.setInitializeLogging(true);               environmentConfig.setErrorStream(System.err);
    environmentConfig.setLockDetectMode(LockDetectMode.MINWRITE);               environmentConfig.setJoinEnvironment(true);               environmentConfig.setThreaded(true);
    xmlManagerConfig = new XmlManagerConfig();               xmlManagerConfig.setAdoptEnvironment(true);               xmlManagerConfig.setAllowAutoOpen(true);               xmlManagerConfig.setAllowExternalAccess(true);
    xmlContainerConfig = new XmlContainerConfig();               xmlContainerConfig.setAllowValidation(false);               xmlContainerConfig.setIndexNodes(true);               xmlContainerConfig.setNodeContainer(true);
    // initialize
    instance.xmlManager = new XmlManager(instance.getEnvironment(),                    instance.getXmlManagerConfig());
    instance.xmlContainer = instance.xmlManager.openContainer(                              containerName, instance.getXmlContainerConfig());
    private ThreadLocal<XmlTransaction> transaction = new ThreadLocal<XmlTransaction>();
    public XmlTransaction getTransaction() throws Exception {
              if (transaction.get() == null) {
                   XmlTransaction t = xmlManager.createTransaction();
                   log.info("Transaction created, id: " + t.getTransaction().getId());
                   transaction.set(t);
              } else if (log.isDebugEnabled()) {
                   log.debug("Reusing transaction, id: "
                             + transaction.get().getTransaction().getId());
              return transaction.get();
         private XmlQueryContext createQueryContext(String docName) throws Exception {
              XmlQueryContext context = xmlManager.createQueryContext(
                        XmlQueryContext.LiveValues, XmlQueryContext.Lazy);
              List<NamespacePrefix> namespacePrefixs = documentPrefixes.get(docName);
              // declare ddi namespaces
              for (NamespacePrefix namespacePrefix : namespacePrefixs) {
                   context.setNamespace(namespacePrefix.getPrefix(), namespacePrefix
                             .getNamespace());
              return context;
         public XmlResults xQuery(String query) throws Exception {
              XmlQueryExpression xmlQueryExpression = null;
              XmlQueryContext xmlQueryContext = getQueryContext(docName);
              try {
                   xmlQueryExpression = xmlManager.prepare(getTransaction(), query,
                             xmlQueryContext);
                   log.info(query.toString());
              } catch (Exception e) {
                   if (xmlQueryContext != null) {
                        xmlQueryContext.delete();
                   throw new DDIFtpException("Error prepare query: " + query, e);
              XmlResults rs = null;
              try {
                   rs = xmlQueryExpression.execute(getTransaction(), xmlQueryContext);
              // catch deadlock and implement retry
              catch (Exception e) {
                   throw new DDIFtpException("Error on query execute of: " + query, e);
              } finally {
                   if (xmlQueryContext != null) {
                        xmlQueryContext.delete();
                   xmlQueryExpression.delete();
              return rs;
    <?xml version="1.0" encoding="UTF-8"?>
    <Test version="0.1">
    <Project id="test-project" agency="dda">
    <File id="large-doc.xml" type="ddi"/>
    <File id="complex-doc.xml" type="ddi"/>
    </Project>
    <Project id="2nd-project" agency="test.org"/>
    </Test>
    Problem:
    All the queries are run through the xQuery method and I do delete the XmlResults afterwards. How do I get around the 'Transaction specified for a non-transactional database' what is the transactions doing? How do I get state information out of a transaction? What am I doing wrong here?
    1 First I insert a node:
    Transaction created, id: -2147483647
    Adding document: large-doc.xml to xml container
    Reusing transaction, id: -2147483647
    Working doc: ddieditor.xml
    Root element: Test
    Reusing transaction, id: -2147483647
    insert nodes <Project id="JUnitTest" agency="test.org"></Project> into doc("dbxml:/ddieditor.dbxml/ddieditor.xml")/Test
    Reusing transaction, id: -2147483647
    2 Then do a query:
    Reusing transaction, id: -2147483647
    doc("dbxml:/ddieditor.dbxml/ddieditor.xml")/Test/Project/@id
    Reusing transaction, id: -2147483647
    3 The same query again:
    Reusing transaction, id: -2147483647
    doc("dbxml:/ddieditor.dbxml/ddieditor.xml")/Test/Project/@id
    Reusing transaction, id: -2147483647
    4 Delete a node:
    Reusing transaction, id: -2147483647
    delete node for $x in doc("dbxml:/ddieditor.dbxml/ddieditor.xml")/Test/Project where $x/@id = '2nd-project' return $x
    Reusing transaction, id: -2147483647
    5 Then an error on query:
    Reusing transaction, id: -2147483647
    doc("dbxml:/ddieditor.dbxml/ddieditor.xml")/Test/Project/@id
    Reusing transaction, id: -2147483647
    Transaction specified for a non-transactional database
    com.sleepycat.dbxml.XmlException: Error: Invalid argument, errcode = DATABASE_ERROR
         at com.sleepycat.dbxml.dbxml_javaJNI.XmlResults_hasNext(Native Method)
         at com.sleepycat.dbxml.XmlResults.hasNext(XmlResults.java:136)
    Message was edited by:
    jannikj

    Ok got it solved by increasing the locks lockers and mutex's I allso increased the the log buffer size:
    environmentConfig = new EnvironmentConfig();
                   // general environment
                   environmentConfig.setAllowCreate(true);
                   environmentConfig.setRunRecovery(true); // light recovery on startup
                   //environmentConfig.setRunFatalRecovery(true); // heavy recovery on startup
                   environmentConfig.setJoinEnvironment(true); // reuse of environment: ok
                   environmentConfig.setThreaded(true);
                   // log subsystem
                   environmentConfig.setInitializeLogging(true);
                   environmentConfig.setLogAutoRemove(true);
                   environmentConfig.setLogBufferSize(128 * 1024); // default 32KB
                   environmentConfig.setInitializeCache(true); // shared memory region
                   environmentConfig.setCacheSize(2500 * 1024 * 1024); // 250MB cache
                   // transaction
                   environmentConfig.setTransactional(true);
                   environmentConfig.setTxnMaxActive(0); // live forever, no timeout               
                   // locking subsystem
                   environmentConfig.setInitializeLocking(true);
    environmentConfig.setMutexIncrement(22);
    environmentConfig.setMaxMutexes(200000);
    environmentConfig.setMaxLockers(200000);
    environmentConfig.setMaxLockObjects(200000); // default 1000
    environmentConfig.setMaxLocks(200000);
    // deadlock detection
                   environmentConfig.setLockDetectMode(LockDetectMode.MINWRITE);
    In the docs by Oracle it is limited information given regarding the impact of these settings and their options. Can you guys point in a direction where I can find some written answers or it hands on?

  • Send message in a non-transactional context

    I've coded a simple Log4j appender to send error messages to a queue (JMSAppender provided by Log4J is not good for me because it use a publish/subscrive model and use topics instead of queues); the appender has to work in a non transactional context, so the appender has to send always the message to queue although the global transaction rollbacks; I've create queue session settings transacted parameter to false and acknowledgeMode to AUTO_ACKNOWLEDGE , but message is not delivered to queue if the global transaction, started by an EJB Stateless Session Bean, rollbacks; in my environment (IBM WebSphere and IBM MQ), queue connection factory is configured no-XA resource.
    Any suggestions?
    Below the source code.
    Thanks in advance
    context = new InitialContext();
    queueFactory = (QueueConnectionFactory) context.lookup(getQueueConnectionFactoryBindingName());
    queueConnection = queueFactory.createQueueConnection();
    queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    queue = (Queue) context.lookup(getQueueBindingName());
    queueSender = queueSession.createSender(queue);
    queueConnection.start();Rob

    I've coded a simple Log4j appender to send error messages to a queue (JMSAppender provided by Log4J is not good for me because it use a publish/subscrive model and use topics instead of queues); the appender has to work in a non transactional context, so the appender has to send always the message to queue although the global transaction rollbacks; I've create queue session settings transacted parameter to false and acknowledgeMode to AUTO_ACKNOWLEDGE , but message is not delivered to queue if the global transaction, started by an EJB Stateless Session Bean, rollbacks; in my environment (IBM WebSphere and IBM MQ), queue connection factory is configured no-XA resource.
    Any suggestions?
    Below the source code.
    Thanks in advance
    context = new InitialContext();
    queueFactory = (QueueConnectionFactory) context.lookup(getQueueConnectionFactoryBindingName());
    queueConnection = queueFactory.createQueueConnection();
    queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    queue = (Queue) context.lookup(getQueueBindingName());
    queueSender = queueSession.createSender(queue);
    queueConnection.start();Rob

  • Creating a non transaction datasource

    All,
    I am using Quartz to fire Hibernate Jobs. Quartz Scheduler runs as a servlet in tomcat, the Hibernate job is a standalone app.
    The Scheduler calls the app like so:
    Quartz>Shell>Hibernate.
    When I start the Hibernate jobs, they instantly go into a blocked state, basically db dealocks. When view the connections with
    mysql admin, I can see the connections are sleep!
    I heard thru the grapevine that a non-transactional datasource would solve this problem.
    How do I do this? Is it done in tomcat, or do I need to change my hibernate db connection?
    Any ideas?

    You're deadlocking with another process - quite possibly with one of your earlier tasks that stalled for some reason.
    Turning off transactions is a dumb way to fix this - it avoids you finding out what the real problem is, thus curing the symptom but probably not the disease. Find out what's deadlocking and why, then fix that problem properly.

  • Non transactional data source and ejb transaction

    Inside an ejb method with trans-attribute = Required,
    Do a bunch of things using a transactional data source and a bunch of things using
    a non trasnactional data source.
    Looks like the time spent doing the non-transactional data source related work
    does not count for the transaction timeout defined for the ejb.
    So, what happens here, the ejb transaction is suspended ( when I start using the
    non transactional ds ) ?

    Hi,
    "siddiqut" <[email protected]> wrote in message news:3fa7c79d$[email protected]..
    Inside an ejb method with trans-attribute = Required,
    Do a bunch of things using a transactional data source and a bunch of things using
    a non trasnactional data source.
    Looks like the time spent doing the non-transactional data source related work
    does not count for the transaction timeout defined for the ejb.
    So, what happens here, the ejb transaction is suspended ( when I start using the
    non transactional ds ) ?The transaction is not suspended when you call something
    which is not non-transactional.
    Regards,
    Slava Imeshev

  • "Exception thrown in non-transactional EJB invoke"

              When I throw an application exception from within a statless session bean which uses jdbs for DB Lookup Only I get
              "Exception thrown in non-transactional EJB invoke".
              As this is a llokup only I have no Transaction Management
              

    Tao,
              > If your ejb method is in a transaction context, then you throw application
              exception, the container will try to commit the transaction.
              In the case of an application exception, the caller will be responsible for
              committing or rolling back the transaction. (A runtime exception will roll
              back the transaction automatically.) That is why, if you use CMT, that the
              EJB methods call from outside the EJB container (such as from a servlet)
              should never be able to throw runtime exceptions.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Tao Zhang" <[email protected]> wrote in message
              news:3a33c04a$[email protected]..
              >
              > Hi,
              > It's ok because you look after the transaction yourself. probably you use
              the default transaction attribute 'Supports'.
              >
              > If your ejb method is in a transaction context, then you throw application
              exception, the container will try to commit the transaction.
              >
              > Hope this can help.
              > Tao Zhang
              >
              > "Gormless" <[email protected]> wrote:
              > >
              > >When I throw an application exception from within a statless session bean
              which uses jdbs for DB Lookup Only I get
              > >"Exception thrown in non-transactional EJB invoke".
              > >
              > >As this is a llokup only I have no Transaction Management
              >
              

  • Non-transactional datastores

    In the WebLogic 5.1 documentation it mentions that for non-transactional
              datastores in a cluster that you can use a custom "dictionary" object to
              keep track of which webLogic server instance is currently hosting a given
              entity bean. This approach is used to insure the integerity for entity EJBs
              in the cluster.
              My question is, has anyone done this or does someone at WebLogic have an
              example or additional information on what all is required to implement this
              "dictionary" object?
              Thanks in advance,
              Michael
              

    I would suggest that you use read-only entity beans for caching
              non-transactional data. Much of the data on websites is
              non-transactional and can be cached for a while.
              For transactional data, I would use a regular entity bean and incur the
              overhead of going to the db.
              -- Rob
              Michael Rousey wrote:
              >
              > I am runningWL 5.1 in a clustered environment. I have an entity bean which
              > represents a complex hierarchy of objects. I would like to be able to take
              > advantage of a caching mechanism so that every call to the bean does not
              > force a reload from the database. In order to accomplish this I need to
              > either guarantee all calls to a single instance of the bean go to a single
              > machine(so the cache is in sync with the DB), or have a clustered cache(I
              > don't want to try and tackle this). The documentation under "entity EJBs
              > in a cluster" talked about a "dictionary" object that appears to act as a
              > router. The idea is for the dictionary object to keep track of which
              > instance of the bean is deployed on a specific machine in the cluster. All
              > actors would use the dictionary to obtain the specific instance of the bean
              > they need. If the instance is new, then WL would create a new instance in a
              > normal fashion; the dictionary object would keep track of the new instance
              > and forward and new request to the machine where the instance was created.
              > This is similar to factory based routing in WLE.
              >
              > Any help on how to implement this or any additional ideas would be helpful.
              >
              > Thanks,
              >
              > Michael
              >
              > "Rob Woollen" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hmm, I'm not sure what the docs were talking about here.
              > >
              > > Can you provide some more details about what you are trying to do?
              > >
              > > -- Rob
              > >
              > > Michael Rousey wrote:
              > >
              > > > In the WebLogic 5.1 documentation it mentions that for non-transactional
              > > > datastores in a cluster that you can use a custom "dictionary" object to
              > > > keep track of which webLogic server instance is currently hosting a
              > given
              > > > entity bean. This approach is used to insure the integerity for entity
              > EJBs
              > > > in the cluster.
              > > >
              > > > My question is, has anyone done this or does someone at WebLogic have an
              > > > example or additional information on what all is required to implement
              > this
              > > > "dictionary" object?
              > > >
              > > > Thanks in advance,
              > > >
              > > > Michael
              > >
              

  • MySQL non-transactional changed tables ...

    I'm trying to test the rollback functionality of my db connection by executing 2 INSERT statements:
    INSERT INTO Users (login_id,name,language_code) VALUES ('Satanka','Satanka','2')
    "INSERT INTO Users (tlogin_id,name,language_code) VALUES ('Satanka','Satanka','2') // this one should fail becase there is no tlogin_id column in the Users table
    When I run my test program I got the followin error message:
    java.sql.SQLException: Column not found: Unknown column 'tlogin_id' in 'field list'
    at org.gjt.mm.mysql.MysqlIO.sendCommand MysqlIO.java:508)
    at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:561)
    at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:646)
    at org.gjt.mm.mysql.Connection.execSQL(Connection.java:973)
    at org.gjt.mm.mysql.Connection.execSQL(Connection.java:897)
    at org.gjt.mm.mysql.Statement.executeUpdate(Statement.java:230)
    at org.gjt.mm.mysql.jdbc2.Statement.executeUpdate(Statement.java:99)
    at com.pylon.portal.timesheet.datahandling.DBBrokerSingleton.ExecuteSQLUpdate(DBBrokerSingleton.java:70)
    at DBClient.main(DBClient.java:12)
    //to this point I understand everything but next line
    java.sql.SQLException: General error: Warning: Some non-transactional changed tables couldn't be rolled back
    at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:508)
    at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:561)
    at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:646)
    at org.gjt.mm.mysql.Connection.execSQL(Connection.java:973)
    at org.gjt.mm.mysql.Connection.execSQL(Connection.java:897)
    at org.gjt.mm.mysql.Connection.rollback(Connection.java:590)
    at com.pylon.portal.timesheet.datahandling.DBBrokerSingleton.ExecuteSQLU
    pdate(DBBrokerSingleton.java:78)
    at DBClient.main(DBClient.java:12)
    Why a simple insert is a "non-transactional" change?
    I'm creating the connection like this:
    Connection con=DriverManager.getConnection("jdbc:mysql://"+url+"/TimesheetDB?user="+Name+"&password="+Pass);
    con.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_UNCOMMITTED);
    con.setAutoCommit( false );
    I'm using JRE 1.3
    JDBC driver mm.mysql-2.0.4-bin.jar
    mysql server 4.0

    Yes, you're right. I found that the default table type won't let me use transactions, and Mysql Server sent me the message.
    I thought that
    "java.sql.SQLException: General error: Warning: Some non-transactional changed tables couldn't be rolled back"
    refers to a problem inside the virtual machine.
    Now I'm trying to setup the MySql to let me create InnoDB tables. Not so simple eh...
    Thanks for helping

  • Exception in non-transactional EJB invoke:java.lang.NoSuchMethodError

    Hello,
    Iam facing with the following exception while deploying EJB's in Weblogic 5.1. The TX Datasource is setup properly and the application is running fine, when I have modified an existing EJB and while re-deploying, getting the following error:
    Fri Jun 30 22:30:53 EST 2006:<I> <EJB JAR deployment ./lib/deployablePAM_EJB.jar> Exception in non-transactional EJB invoke:
    java.lang.NoSuchMethodError
    at com.bp.downstream.retail.au.pam.dsaf.ejb.site.SiteBeanHomeImpl.preFinderInvoke(SiteBeanHomeImpl.java:906)
    at com.bp.downstream.retail.au.pam.dsaf.ejb.site.SiteBeanHomeImpl.findByGroupIdAgentFlag(SiteBeanHomeImpl.java:217)
    at com.bp.downstream.retail.au.pam.dsaf.ejb.site.SiteBeanHomeImpl_ServiceStub.findByGroupIdAgentFlag(SiteBeanHomeImpl_Servi)
    at com.bp.downstream.retail.au.pam.dsaf.dso.site.SiteDSOEjbImpl.getSitesByGroupIDAgentFlagWithMarkers(SiteDSOEjbImpl.java:9)
    at com.bp.downstream.retail.au.pam.services.ejb.price.PriceBean.getGroupPrices(PriceBean.java:1366)
    at com.bp.downstream.retail.au.pam.services.ejb.price.PriceBeanEOImpl.getGroupPrices(PriceBeanEOImpl.java:366)
    at com.bp.downstream.retail.au.pam.services.serviceobject.GetGroupPrices.callService(GetGroupPrices.java:74)
    at au.com.oakton.ecore.services.ServiceManager.callService(ServiceManager.java:47)
    at au.com.oakton.ecore.request.RequestHandler.processRequest(RequestHandler.java:173)
    at com.bp.downstream.retail.au.pam.serviceaccess.ServiceBean.invoke(ServiceBean.java:66)
    at com.bp.downstream.retail.au.pam.control.PriceGroupAction.perform(PriceGroupAction.java:94)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:158)
    at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:158)
    at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:158)
    at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:158)
    at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Please help me in understanding when we get such an exception.

    Hello All,
    I am getting the 'Exception in non-transactional EJB invoke:java.lang.NoSuchMethodError', even if I have not made any modifications in the code. As and when I am re-deploying the deployablePAM_EJB.jar, and exception is raised. I am I missing out something here ?.
    Please let me know.

  • How to store data in NON -Transactional ODS

    Hi,
    for reporting reasons I wish to store data in non-transactional ODS. Reading in this forum I found only the standard fm 'RSDRI_ODSO_MODIFY' but this fm is used only for transactional ODS.
    Any suggestions?
    Thanks in advance.
    Regards,
        Giovanni

    First of all, many thanks for the quick reply.
    To focus on my problem I have the necessity to realise what it is detailed in a document at this url:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60938938-de6f-2910-2080-fc80d38ebfec
    Working in SEM environment I have the necessity to handle text field in a non-transactional ODS for reporting without using an InfoSet.
    Observing the exceptions raised by calling the fm 'RSDRI_ODSO_MODIFY' it is possible to find the ODS_TYPE_NOT_TRANSACTIONAL showing that a non-transactional ODS is not handled.
    I hope to have explained my intention and my problem and I'm confident to receive your support.
    Thanks.
        Giovanni

  • Mac pro put in new ram now none of the ram works

    mac pro put in new ram now none of the ram works
    it just hangs on restart
    the ram worked great for 12 hours then the computer restarted on its own
    since then it hangs on restart and never gets to the desktop

    It may not have anything to do with the RAM, or it might.
    Not enough to go by to say for certain, and the blunt "get new RAM" doesn't address how to troubleshoot or resolve most likely.
    Was it installed properly?
    How much did you install?
    Make? vendor.
    Try running with just the new RAM.
    Run Apple Hardware Test - boot 'd' key on startup, you may need your OEM Install DVD.
    Run Rember and/or Memtest utility to test memory, or TechTool Deluxe.
    When a computer restarts on its own it often means there was a kernel panic or something and damage to files, directory, journal and in need of repair, booting off your DVD or another drive to repair the drive, delete some files, turn journaling off and then on.
    http://docs.info.apple.com/article.html?artnum=106227
    http://www.macmaps.com/kernelpanic.html
    http://www.thexlab.com/faqs/kernelpanics.html

  • Is it possible to use non-transacted AQ/JMS QueueSession

    I have been trying to make a WebLogic MDB to listen to an AQ Queue but run into a problem that Oracle AQ does not seem to support non-transacted QueueSession. For further details about my problem, please see:
    http://marvel.oracle.com/pls/otn/f?p=17000:8:141022503303280030::NO::F17000_P8_DISPLAYID,F17000_P8_CRITERIA:40460583213,
    If you have a solution, please post it here or at Cameron O'Rourke's DevTrend website. Thanks.
    Eric Ma

    Have you posted source code and configuration
    instructions? I just posted some sample code at
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jms&item=12376&utag=

  • JMS event generator only gets non-transactional queue msg

    Hi,
    I have created a JMS event generator to listen to a particular queue. It seems to work perfectly fine if, when posting a message to the queue that the JMS EG is listening to, the queue created is a non-transactional queue, i.e. queueConnection.createQueueSession(false, ...).
    However if I created a transactional queue to post message to the JMS EG, i.e. queueConnection.createQueueSession(true, ...), then the JMS EG can't seem to see the message. I checked in the WLI Admin console, JMS EG section, and there are no messages read by the particular JMS EG after I have posted the msg to the queue.
    My question is: is there a known limitation on the JMS EG that it can only read from a non-transactional JMS queue, or is this a bug? (I am using weblogic 8.1 sp2).
    Thanks
    Regards,
    xlfhk

    Hi,
    sorry, just discovered it's my mistake. Instead of using the transaction created when calling queueConnection.createQueueSession(true, ...), and committing that, I created a JTA transaction artificially wrapping the entire chunk of code.
    As a result, I ended up with a pair of transactions that are nested (I think ...), and the external transaction's commit was called when the nested JMS transaction hasn't been committed yet. As a result, no commit ever took place (I think again ...).
    I have now tried calling queueSession.commit() after sending the message. It seems to work fine. Thanks for the help.
    Regards,
    xlfhk.

Maybe you are looking for

  • No music in ipod, but says there is!?

    when i was updating my ipod and charged it i disconnected it and left it alone then i wantd to listen to it and nothing was on it. then when i plugged it in my computer it said i have no space on my i-pod but nothing was on it. i cant figure it out s

  • Package and the transport number for Parameter id

    Hi , Based on a posting earlier to create a Parameter id , wanted to know what is is the best practice to fill in the PACKAGE NAME while creating a Parameter id in SM30 table TPARA?

  • Urgent help please! keystrokes on N95 to switch o...

    hi there - the screen on my N95 has inexplicably broken, even though it was just in my handbag.  anyway, could someone please list the keystrokes i need to go through to switch on bluetooth on my phone, so that i can do a backup on my laptop?  the ph

  • How to make other people image more beautiful

    how to make other people image more beautiful?

  • Movieclip link to new webpage

    I want to have a movieclip "button" that when clicked will go to another page on a website, a different URL, not another frame in the flash application. I am trying to use this actionscript var targetPage:URLRequest = new URLRequest("update0709-2.htm