Internally started external transaction,release causes ConcurrencyException

I will try to explain my problem with a very very simplified code example.
(The code is not entirely correct; consider it to be pseudocode)
Below the onMessage method of a Message Driven (TestMDB) bean is shown.
The mdb bean is configured not to have a container managed transaction; Transaction attribute is 'NotSupported'.
Toplink is configured to use a external transaction controller.
onMessage(Message message)
try
String sessionId = Guid.generateGUID(message);
uow = getUnitOfWork(sessionid);
ObjectToPersist obj = new ObjectToPersist();
uow.registerNewObject(obj);
     // the following release would normally only be performed in case of an exception
uow.release();
public UnitOfWork (String sessionId) {
ClientSession session = (ClientSession)sessionProvider.getSession(sessionId);
uow = session.getActiveUnitOfWork();
if(uow == null)
uow = session.acquireUnitOfWork();
Now when this very simple piece of code above is executed an external transaction is internally started.
But the statement "uow.release()" produces the following exception stack:
Exception [TOPLINK-2004] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.ConcurrencyException
Exception Description: A signal was attempted before wait() on ConcurrencyManager. This normally means that an attempt was made to
commit or rollback a transaction before it was started, or to rollback a transaction twice.
     at oracle.toplink.exceptions.ConcurrencyException.signalAttemptedBeforeWait(ConcurrencyException.java:63)
     at oracle.toplink.internal.helper.ConcurrencyManager.release(ConcurrencyManager.java:336)
     at oracle.toplink.publicinterface.Session.rollbackTransaction(Session.java:2771)
     at oracle.toplink.publicinterface.UnitOfWork.rollbackTransaction(UnitOfWork.java:4138)
     at oracle.toplink.publicinterface.UnitOfWork.rollbackTransaction(UnitOfWork.java:4159)
     at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(UnitOfWork.java:1340)
     at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1389)
     at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(UnitOfWork.java:2866)
     at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(UnitOfWork.java:2846)
     at oracle.toplink.jts.oracle9i.Oracle9iJTSSynchronizationListener.beforeCompletion(Oracle9iJTSSynchronizationListener.java:61)
     at com.evermind.server.ApplicationServerTransaction.callSynchronizationBeforeCompletion(ApplicationServerTransaction.java:1447)
     at com.evermind.server.ApplicationServerTransaction.beforeCompletion(ApplicationServerTransaction.java:1296)
     at com.evermind.server.ApplicationServerTransaction.rollback(ApplicationServerTransaction.java:594)
     at com.evermind.server.ApplicationServerTransaction.rollback(ApplicationServerTransaction.java:572)
     at oracle.toplink.jts.JTSExternalTransactionController.rollbackTransaction(JTSExternalTransactionController.java:151)
     at oracle.toplink.publicinterface.Session.rollbackExternalTransaction(Session.java:2739)
     at oracle.toplink.publicinterface.Session.rollbackTransaction(Session.java:2777)
     at oracle.toplink.publicinterface.UnitOfWork.rollbackTransaction(UnitOfWork.java:4138)
     at oracle.toplink.publicinterface.UnitOfWork.release(UnitOfWork.java:3972)
     at nl.portinfolink.platform.normalizer.emp.service.TestMDB.onMessage(TestMDB.java:007)
If      "uow.release()" is replaced by "uow.commit()" all works fine. It is ok to commit a uow that is associated with an external
transaction that is internally started.
But why does the release cause an exception?
Specifications:
Appserver: oc4j(9.0.4)
Toplink 10.1.3.3
EJB 2.1

This is odd. From the stack even though the uow.release() is rolling back the JTA transaction, it is still raising the beforeCompletion event (which is incorrect, I think a issue with OC4J 9.0.4 but was fixed in OC4J 10.2 or 10.1.3).
Note that you are using a deprecated transaction controller, try using
oracle.toplink.transaction.oc4j.Oc4jTransactionController, this might work correctly. Otherwise you could customize your transaction controller to ignore the beforeCompletion callback if the transaction is in a rollback state.
<p>---
<br>James Sutherland
<br>Oracle TopLink, EclipseLink
<br>Wiki: Java Persistence, EclipseLink

Similar Messages

  • No external transaction assigned to internal transaction 0020 / 0010

    Hi gurus..
    While iam doing invoice  its shows error like
    "No external transaction assigned to internal transaction 0020 / 0010"
    Where i need to maintain external transactions?
    can any one please tel the complete path for that...
    thanks...

    Hello,
    Financial Accounting / Contract Accounts Receivable and Payable / Basic Functions / Postings and Documents / Document / Maintain Document Assignments / Maintain Transactions for IS-U/IS-T / Maintain Transactions for Cash Security Deposits/Interest
    There, go to Define Main Transaction, select main transaction 0020, double click Define Sub-Transactions, select subtransaction 0010, double click Allocate Transactions to Internal Transactions and do the allocation there.
    If you didn't define the combination of main transaction and subtransaction for cash security deposit payment, do that first, then follow the steps described above. If you define other main/sub transaction (for example AAAA/BBBB), replace "select main transaction 0020" with "select main transaction AAAA", and "select subtransaction 0010" with "select subtransaction BBBB" in the steps above.
    Hope this helps.
    Bogdan

  • Internal transaction not assigned to external transaction

    Hi,
    while running the transaction FP08, it showed me an error saying that "Internal transaction 0060 0020 is not assigned to an external transaction". Can any1 please help me what the problem is and how to sort the error as well as the proper running process of the transaction FP08?

    Check you config under the IMG Activites:
    -Basic Functions > Posting & Documents > Document > Maintain Document Assignments > Maintain Transaction > Define and Parameterize External Transactions
    -Basic Functions > Posting & Documents > Document > Maintain Document Assignments > Maintain Transaction > Assign External Transactions

  • Transaction to rate an internal and external instructor

    How to set rating for internal and external instructor and also write comments about the training

    in the business event appriasal
    You can create a criteria grp Faculty
    and you can add Criterias like
    -Ability to draw Participation
    -Communication Skills
    -Faculty's Knowledge

  • How does TopLink determine external transaction controller is active?

    Weblogic 9.2. I am having a problem with a new EJB: getExternalTransactionController() is null, getActiveUnitOfWork() is null, and yet when my code issues a commit, TopLink throws 4002 [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Cannot call commit when using distributed transactionsError Code: 0. Our code uses getActiveUnitOfWork() to decide whether to issue the commit or not. I had to turn off external transactions for the time being by changing the attribute in ejb-jar.xml to supports.
    This is one of those crazy making problems where the session is (except for the deployment.xml) identical to one for an EJB that is not having any external transaction problems. They are deployed in the same ear and the ejb-jar.xml configuration was the same before I changed the failing EJB to supports.
    What attribute causes TopLink to throw the 4002?
    Thanks

    If you configure TopLink to use an external transaction controller then you should use container managed transactions where the the declared transactions on session/message-driven beans control the transaction begin/commit or use the container's UserTransaction to control the transaction life cycle. TopLink's beginTransaction and commitTransaction should not be used as you have decided that the container controls the transactions externally of TopLink's control.
    When using TopLink with an external transaction controller the getActiveUnitOfWork looks up the active transaction in the container and returns a UnitOfWork unique per container transaction. If no transaction is active then null is returned.
    Note: the UnitOfWork.commit() only has an effect when not using an external transaction controller. If you are using an external transaction controller then UnitOfWork.commit() will only flag the UnitOfWork as complete but will not atually write any changes.
    I am not sure I am answering you question but hope this helps.
    Doug

  • Can Oracle Bulkcopy write data within an external transaction?

    Hi Everyone,
    I am new to odp.net and I hope somebody can help me with an issue about bulkcopy. What I want to do is to make the process of a bulkcopy executed within a transaction. The transaction here should be external and when it comes to the point where bulkcopy is executed, the transation has already begun and has executed some other commands. The way how i want to do this is described as follow
    Step 1: Create a connection (e.g. dbConn)
    Step 2: Use that connection to start a transaction (e.g. dbConn.BeginTransaction)
    Step 3: Use the connection to create and execute some commands (e.g. delete/insert/update some records in a table)
    Step 4: Create an OracleBulkCopy instance with that connection (e.g. Dim copier As DBBulkCopy = New OracleBulkCopy(dbConn, OracleBulkCopyOptions.Default) )
    Step 5: Use the WriteToServer function in the bulkcopy to copy some data across tables (e.g. copier.writetoserver(datatable))
    Step 6: Commit the transaction.
    Now when i run to Step 5, the WriteToServer function, an exception is thrown. The error is "ORA-26085: direct path operation must start its own transaction"
    As far as I understand, it is telling me the transaction of the connection (dbConn in this example) has begun before the WriteToServer is executed. Howevery, putting the bulkcopy process within an transaction is exactly what I want and it is very critical to the task I am trying to finish.
    Can any body let me know how to implement this?
    Thanks very much

    I see following note in Oracle Data Provider for .NET Developer's Guide 11g Release 1 (11.1.0.7.20) -
    "Note: All bulk copy operations are agnostic of any local or distributed transaction created by the application."
    Hence it seems that Bulk Copy operations should not be used with user transactions.

  • Randomly occurring error while starting MDB transaction

    We have been seeing a strange intermittent problem with MDBs in a clustered WLS 9.1 environment. Our cluster consists of two managed servers, each of which runs on a separate Windows machine, and our application is targeted to both. We use container managed transactions. From time to time, one of the MDBs on the second managed server runs into a problem where it is unable to start a transaction, and the message is automatically transferred to the appropriate JMS error destination before the logic within the onMessage method is even invoked. This results in a situation where our app logs have no record that the message was ever received, so we continually have to go out to the error destinations to see if there are any messages. This problem does not appear to follow any pattern, and occurs randomly with pretty much all of our MDBs on the second server. The stack trace from the log is below. Any help in tracking down the cause of this problem would be greatly appreciated.
    Regards,
    Sabrina
    <Jun 12, 2006 2:02:47 PM EDT> <Error> <JMSClientExceptions> <BEA-055165> <The following exception has occurred:
    java.lang.RuntimeException: [EJB:010166]Error occurred while starting transaction: weblogic.jms.common.JMSException: Unexpected remote responsenull.
    java.lang.RuntimeException: [EJB:010166].
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:282)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:3824)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:3738)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4228)
         at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
         Truncated. see log file for complete stacktrace
    weblogic.jms.common.JMSException: Unexpected remote responsenull
         at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
         at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncTran(DispatcherAdapter.java:53)
         at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:1775)
         at weblogic.jms.client.JMSSession.associateTransaction(JMSSession.java:1854)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:269)
         Truncated. see log file for complete stacktrace
    weblogic.jms.common.JMSException: Unexpected remote responsenull
         at weblogic.jms.dispatcher.Request.handleThrowable(Request.java:63)
         at weblogic.jms.dispatcher.Request.getResult(Request.java:51)
         at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:803)
         at weblogic.messaging.dispatcher.DispatcherImpl.dispatchSyncTran(DispatcherImpl.java:197)
         at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncTran(DispatcherAdapter.java:51)
         Truncated. see log file for complete stacktrace
    weblogic.jms.common.JMSException: Unexpected remote responsenull
         at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:758)
         at weblogic.messaging.dispatcher.DispatcherImpl.dispatchSyncTran(DispatcherImpl.java:197)
         at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncTran(DispatcherAdapter.java:51)
         at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:1775)
         at weblogic.jms.client.JMSSession.associateTransaction(JMSSession.java:1854)
         Truncated. see log file for complete stacktrace
    weblogic.jms.common.JMSException: Unexpected remote responsenull
         at weblogic.jms.dispatcher.Request.getAppException(Request.java:42)
         at weblogic.messaging.dispatcher.Request.handleResult(Request.java:529)
         at weblogic.rmi.extensions.AsyncResultFactory$CallbackableResultImpl.setInboundResponse(AsyncResultFactory.java:75)
         at weblogic.rjvm.BasicOutboundRequest$BasicResponseListener.response(BasicOutboundRequest.java:217)
         at weblogic.rjvm.ResponseWithListener.notify(ResponseWithListener.java:25)
         Truncated. see log file for complete stacktrace
    java.lang.ClassCastException: weblogic.rjvm.ClassTableEntry
         at weblogic.rjvm.MsgAbbrevInputStream.readExtendedContexts(MsgAbbrevInputStream.java:216)
         at weblogic.rjvm.ResponseImpl.retrieveThreadLocalContext(ResponseImpl.java:126)
         at weblogic.rjvm.ResponseWithListener.unmarshalReturn(ResponseWithListener.java:43)
         at weblogic.rmi.internal.AsyncResultImpl.getResults(AsyncResultImpl.java:48)
         at weblogic.rmi.internal.AsyncResultImpl.getObject(AsyncResultImpl.java:98)
         Truncated. see log file for complete stacktrace
    >

    Hi Sabrina,
    Did you ever get a solution to this problem?
    We are seeing the same thing on WebLogic 9.1. It started happening in the past week.
    We have the same originating error ..
    java.lang.ClassCastException: weblogic.rjvm.ClassTableEntry
    Many thanks,
    Shane

  • External Firewire HDD causes hangs on my Mac Pro & HDD lag using finder

    External Firewire HDD causes hangs on my Mac Pro & HDD lag using finder.
    I have an 2008 Mac Pro 8 core 2.66hz, 10GB Mem, ATI HD4870 with 4 internal 1 TB Drives. I have 3 external HDDs (2 USB + 1 FW400). The 2 USB HDDs are for Time Machine and backups.
    The external FW HD is a 1TB bootable clone of my Internal 1 TB boot HDD.
    I have 2 problems ... somethimes when using finder or opening a folder, copying files, starting or quiting a program, I get the spinning beach ball that seems to hang the Mac.
    I power off the external FW HDD and everything starts to work. I get an error about the device going offline, I then power the FW HDD back on and all is good.
    It seems the external FW Drive tends to hang the system. It occurs pretty frequently.
    Any recommendations?
    The other issue is that when I use finder to go to a folder, I seem to have to wait for all these drive to spin up. You can hear them all start whirring.
    is there a way to remove that lag?

    If you recently moved to Snow Leopard you might look for new firmware for your external drive. I would also get DiskWarrior and run that on the external and consider programs like Drive Genius. You might also back it up and wipe it and restore the data. After that I'd consider looking at a new external.
    Sleeping drives that take time to spin up after waking....I'd like to learn how to stop that myself. Be sure the Energy Saver in System Preferences is set to not put drives to sleep when possible. Even then my drives will go to sleep and I have up to 6 external added at times and they take quite a while to all spin up. I've never found a way to prevent that.
    BTW...external USB drives on a MacPro? Really? Even for backup....

  • EclipseLink Error looking up external Transaction resource under JNDI name

    I want to verify my EJB 3.0 setup for a Java EE project to be deployed on Weblogic 10.3.3 (11gR2) - however when trying to run the JUnit test from eclipse I keep getting the following exception :
    Exception [EclipseLink-23004] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error obtaining the Transaction Manager
    Internal Exception: Exception [EclipseLink-23001] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error looking up external Transaction resource under JNDI name [weblogic.transaction.TransactionManager]
    Internal Exception: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at org.eclipse.persistence.exceptions.TransactionException.errorObtainingTransactionManager(TransactionException.java:125)
         at org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:69)
         at org.eclipse.persistence.transaction.wls.WebLogicTransactionController.<init>(WebLogicTransactionController.java:27)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(PrivilegedAccessHelper.java:354)
         at org.eclipse.persistence.platform.server.ServerPlatformBase.initializeExternalTransactionController(ServerPlatformBase.java:247)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:656)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:581)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:369)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
         at com.junit.ejb.orclperf.EjbValidation.setUp(EjbValidation.java:27)
         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:597)
         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
         at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: Exception [EclipseLink-23001] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error looking up external Transaction resource under JNDI name [weblogic.transaction.TransactionManager]
    Internal Exception: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at org.eclipse.persistence.exceptions.TransactionException.jndiLookupException(TransactionException.java:47)
         at org.eclipse.persistence.transaction.AbstractTransactionController.jndiLookup(AbstractTransactionController.java:434)
         at org.eclipse.persistence.transaction.wls.WebLogicTransactionController.acquireTransactionManager(WebLogicTransactionController.java:35)
         at org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:67)
         ... 40 more
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at org.eclipse.persistence.transaction.AbstractTransactionController.jndiLookup(AbstractTransactionController.java:432)
         ... 42 more
    [EL Finest]: 2010-05-23 21:29:36.629--ServerSession(30149247)--Thread(Thread[main,5,main])--End deploying Persistence Unit PERFEJB; session file:/C:/Users/owner/workspace/PERFEJB/build/classes/_PERFEJB; state Deployed; factoryCount 2The code for the JUnit test is the following:
    package com.junit.ejb.orclperf;
    import static org.junit.Assert.*;
    import java.util.Calendar;
    import java.util.Date;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.junit.Before;
    import org.junit.Test;
    import eJBgetSet.Attachment;
    import eJBgetSet.Request;
    public class EjbValidation {
         private static final String PERSISTENCE_UNIT_NAME="PERFEJB";
         private EntityManagerFactory factory;
         @Before
         public void setUp() throws Exception {
              factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
              EntityManager em = factory.createEntityManager();
              em.getTransaction().begin();
              Query q = em.createQuery("select r from Request r");
              Calendar c = Calendar.getInstance();
              c.add(Calendar.DAY_OF_MONTH,5);
              Date dnow = c.getTime();
              String[] type= {"Databank","SQL File","Script","Scenario Recording","Other"};
              byte[] junitattachment  = (byte[])"abcdefghijklmnopqrstuvwxyz".getBytes();
              boolean createNewEntries = (q.getResultList().size()==0);
              if(createNewEntries){
                   assertTrue(q.getResultList().size() == 0);
                   Request request = new Request();
                   request.setRequestid(0);
                   request.setReqdescription("JUnit Testing record addition with JPA");
                   request.setReqjustification("Validate EclipseLink/WebLogic/EJB 3.0 setup for this project");
                   request.setProjectreference("Development Task Performance Analysis 1");
                   request.setReqresultdate(dnow);
                   request.setReqstatus(0);
                   em.persist(request);
                   int x=0;
                   for(int i=0; i<10;i++){
                        Attachment attachment = new Attachment();
                        attachment.setAttachmentid(i);
                        attachment.setAttachname("File"+i);
                        attachment.setAttachdate(c.getTime());
                        if(i==5){
                             x=0;
                        }else{
                             x++;
                        attachment.setAttachtype(type[x]);
                        attachment.setAttachuser("User"+i);
                        attachment.setAttachsize(String.valueOf(junitattachment.length));
                        attachment.setAttachfile(junitattachment);
                        em.persist(attachment);
                        request.getPerfAttachments().add(attachment);
                        em.persist(attachment);
                        em.persist(request);
                   em.getTransaction().commit();
                   em.close();
         @Test
         public void testFindAll() {
              EntityManager em = factory.createEntityManager();
              Query q = em.createQuery("select a from perf_attachment a");
              assertTrue(q.getResultList().size() == 10);
              em.close();
         @Test
         public void testSave() {
              EntityManager em = factory.createEntityManager();
              Query q = em.createQuery("select r from req_perf_header");
              assertTrue(q.getResultList().size() == 1);
              assertTrue(((Request) q.getResultList()).getPerfAttachments().size() ==10);
              em.close();
    }Finally the persistence.xml file being used is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0"
         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
         <persistence-unit name="PERFEJB" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>jdbc/ORCLPERF</jta-data-source>
              <class>eJBgetSet.User</class>
              <class>eJBgetSet.Transaction</class>
              <class>eJBgetSet.Request</class>
              <class>eJBgetSet.PerfStatus</class>
              <class>eJBgetSet.Attachment</class>
              <class>eJBgetSet.Approver</class>
              <properties>
                   <property name="eclipselink.target-server" value="WebLogic_10" />
                   <property name="eclipselink.logging.level" value="FINEST" />
                   <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
                   <property name="eclipselink.jdbc.platform"
                        value=" org.eclipse.persistence.platform.database.oracle.OraclePlatform " />
                   <property name="eclipselink.jdbc.url"
                        value="jdbc:oracle:thin:@localhost:1521:orcl11g:create=true" />
                   <property name="eclipselink.jdbc.user" value="<username>" />
                   <property name="eclipselink.jdbc.password" value="<password>" />
                   <property name="eclipselink.logging.level" value="ALL" />
                   <property name="eclipselink.logging.timestamp" value="true" />
                   <property name="eclipselink.logging.exceptions" value="true" />
                   <property name="eclipselink.logging.session" value="true" />
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
                   <property name="eclipselink.ddl-generation.output-mode"
                        value="database" />
              </properties>
         </persistence-unit>
    </persistence>Any help would be much appreciated. Many Thanks

    You have it set to run on the WebLogic platform so it is looking up the TransactionManager from JNDI, but are running the test from within the EclipseIDE. Try deploying it to Weblogic and running it there, or change your persistence.xml settings so that it can connect/run outside the server.
    Best Regards,
    Chris

  • Internal microphone doesn't release control

    When I try to use an external microphone (Bluetooth or USB) the internal microphone don't release control to the external microphone. thus I then have two microphones receiving input from both microphones and my programs can't recognize my speech to input.
    Can anybody help?

    i got a macbook pro, 2 weeks ago, the 2.53Ghz unibody aluminium, the desing of this mac is great even tough the system specs are really low for the price actually, im happy with it(the hardware)...
    The only reason i got this is cause apple claims to support windows, i like Mac OS, but i work on windows i need it... if theres no windows capability in mac i wouldnt ever buy one, so this issue is really bothering me A LOT. my impresions about apple are changing after seing this topic filled with questions and not a single moderator answer, go and check a logitech forum and see how they take care about user problems.

  • Can I split my itunes music library between and internal and external hard drive?

    Is it possible to have music on the two different drives and still be able to make playlists from both drives to put on my ipod?  Here's my situation:  I'm using a Dell 32 bit computer running Vista Home Premium SP2 which I share with other users.  I have a large itunes library (40g+ of music only) that's starting to hog the hard disk space from other users. If possible, I would like to split off part of my itunes library to an external hard drive while still having access to the entire library for my ipod. Ideally I would like to have all my downloaded songs on both the internal and external drives so I'll have backups in case a drive fails, while putting all the music I have hard copies of solely on the external drive. Any help on how this can be done would be appreciated.

    If you manually manage your itues library, you can store parts of it on an external drive, or on an internal drive.  Just keep in mind that in iTunes that you must set a default location for iTunes to manage it's files, and that will be the default location for iTunes to store anything it downloads.  You would need to manuay manage moving things from there if tht is not where you want them stored.
    Perhaps a "better" solution would be for you to invest a little mone into 2 external drives.  One to hold your entire iTunes library, and the second to be your off-line backup of the first.  This is the method I have gone with and I like how it works for me.  My entire iTunes library is on an external (portable) 320GB drive.  Then, when iTunes is not running, I will clone my external drive onto a second drive I happen to have, this way if I have any failure of my primary drive, I lose at most about a weeks worth of content.  For me, I purchase little content during a week, but I do move a fairly large volume of podcasts.  With the entire library being on the external drive, if I ever have to swap to using my backup drive iTunes wil just think that it hasn't run and downloaded anything for a week, and all the "lost" content will be re-downloaded automatically.  This won't work for apps or purchased content, but for subscribed podcasts, it is great.

  • Need advise for best practice when using Toplink with external transaction

    Hello;
    Our project is trying to switch from Toplink control transaction to using External transaction so we can make database operation and JMS operation within a single transaction.
    Some of our team try out the Toplink support for external transaction and come up with the following initial recommendation.
    Since we are not familar with using external transaction, I would like member of this forum and experts, to help comment on whether these recommendation are indeed valid or in line with the best practice. And for folks that have done this in their project, what did you do ?
    Any help will be most appreciated.
    Data Access Objects must be enhanced to support reading from a TOPLink unit of work when using an external transaction controller. Developers must consider what impact a global transaction will have on the methods in their data access objects (DAOs).
    The following findSomeObject method is representative of a “finder” in the current implementation of our DAOs. It is not especially designed to execute in the context of a global transaction, nor read from a unit of work.
    public findSomeObject(ILoginUser aUser, Expression queryExpression)
    ClientSession clientSession = getClientSession(aUser);
    SomeObject obj = null;
    try
    ReadObjectQuery readObjectQuery = new ReadObjectQuery(SomeObject.class);
    readObjectQuery.setSelectionCriteria(queryExpression);
    obj = (SomeObject)clientSession.executeQuery(readObjectQuery);
    catch (DatabaseException dbe)
    // throw an appropriate exception
    finally
    clientSession.release();
    if (obj == null)
    // throw an appropriate exception
    return obj;
    However, after making the following changes (in blue) the findSomeObject method will now read from a unit of work while executing in the context of a global transaction.
    public findSomeObject(ILoginUser aUser, Expression queryExpression)
    Session session = getClientSession(aUser);
    SomeObject obj = null;
    try
    ReadObjectQuery readObjectQuery = new ReadObjectQuery(SomeObject.class);
    readObjectQuery.setSelectionCriteria(queryExpression);
    if (TransactionController.getInstance().useExternalTransactionControl())
         session = session.getActiveUnitOfWork();
         readObjectQuery.conformResultsInUnitOfWork(); }
    obj = (SomeObject)session.executeQuery(readObjectQuery);
    catch (DatabaseException dbe)
    // throw an appropriate exception
    finally
    if (TransactionController.getInstance().notUseExternalTransactionControl())
         session.release();
    if (obj == null)
    // throw an appropriate exception
    return obj;
    When getting the TOPLink client session and reading from the unit of work in the context of a global transaction, new objects need to be cached.
    public getUnitOfWork(ILoginUser aUser)
    throws DataAccessException
         ClientSession clientSession = getClientSession(aUser);
         UnitOfWork uow = null;
         if (TransactionController.getInstance().useExternalTransactionControl())
              uow = clientSession.getActiveUnitOfWork();
              uow.setShouldNewObjectsBeCached(true);     }
         else
              uow = clientSession.acquireUnitOfWork();
         return uow;
    }

    As it generally is with this sort of question there is no exact answer.
    The only required update when working with an External Transaction is that getActiveUnitOfWork() is called instead of acquireUnitOfWork() other than that the semantics of the calls and when you use a UnitOfWork is still dependant on the requirements of your application. For instance I noticed that originally the findSomeObject method did not perform a transactional read (no UnitOfWork). Has the requirements for this method changed? If they have not then there is still no need to perform a transactional read, and the method would not need to change.
    As for the requirement that new object be cached this is only required if you are not conforming the transactional queries and adds a slight performance boost for find by primary key queries. In order to use this however, objects must be assigned primary keys by the application before they are registered in the UnitOfWork.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • All my hard drives (internal and external) have a small lock in the lower left corner of the icon and I don't have permissions to access. Permissions are set to 'Custom' in the get info window and I can't change them.

    All my hard drives (internal and external) have a small lock in the lower left corner of the icon and I don't have permissions to access. I have 3 user accounts set up and I cannot access any of them.   Permissions are set to 'Custom' in the get info window and I can't change them. Originally I had Snow Leopard installed on one hard drive and 10.5.8 installed on another.   I started to have some problems accessing data between them and so I tried changing the permissions on ONE hard drive partition.   The next thing I know, all my drives are locked (except the ones with the systems on them), the small lock appeared in the lower left corner of the drive icons and I don't have permissions to access any of them.   In the get info window, permissions are set to 'Custom' and I can't change them.

    There is suddenly a lock icon on my external backup drive!
    Custom Permissions

  • IMac - internal or external DVD?

    iMac - internal or external DVD? That is the question...
    Can you install a normal DVD burner in an iMac 800MHz flat panel?
    If so, can anyone advice on the technical proceedure?
    If installing an internal drive is easy enough to do, can you please advise on types, makes or specs to install.
    My current DVD drive runs slow and I'd like a DVD burner, so is a seperate external drive the better option?
    External drives just seem so expensive. THANK YOU!

    Hello, 
    Internal.
    Most replacement optical drives should work under Tiger fine. If not Patchburn will be the driver you need.
    Most of us have Pioneer 'superdrives' installed by Apple so it seems sensible to stick with that product line.
    The DVR-112 (18x DVD±RW DL for £21) seems a good deal to me (plus and hour or two of your time).
    It's pretty fiddly to work inside an iMac G4 so you must be cautious. Always take anti-static precautions. Here are three options for guiding you through the procedure:
    MacWorld
    xlr8yourmac
    Service Manuals
    I've also taken a fair few photos which you can find here.
    I'd advise reading the reports on the xlr8yourmac drive database so get other people's experiences first.
    You must replace the Thermal Paste when you close the iMac up or it will overheat.
    It's probably worth replacing the PRAM Battery whilst you're in there as these have a finite life (once they fail to re-charge you may start to run in to snags - it's only a £5 part).
    External.
    A whole lot less effort to install and should you upgrade to an Intel iMac / Mac Mini/ MacBook in the future you'll have access to this faster desktop spec tray loading drive rather than the slow laptop spec slot drive installed in these current Macs.
    Let us know how you get on/what you decide.
    mrtotes

  • Specification documents o internal and external programs documentation

    I have to make some changes in the specification documents o internal and external programs documentation. I want to know i there are defined some standard conventions about the technica objects name and the requirements documentation.
    We have made some formats, but we have seen change resistance=2 The problem is the amount of information required in these ne formats that we think is important and will help to reduc ambiguity and to avoid backworks but it's going to ad activities to the developers.

    . Ours is bit different to what she sampled but the standardization differ from the team implementing it. You must also come out with the pattern for program "pre" and "post" documentation.
    1. Before the actual coding of the program, you have to specify the estimated number of mandays needed for the analysis, coding and documentation. Don't forget to add n% for the buffer. (In our case, we use 30% buffer). Then update the form by putting on the other column the actual mandays consumed. There should not be cases that estimated < actual mandays. If problem is encountered that may cause delay, inform team lead to adjust the estimated mandays.
    2. Create a form that will specifically states the unit testing made (eg. Test case, test data, how the test is perform, outcome of testing, rating: pass or fail, etc.)
    3. After coding, specific program specification (eg. logic of the program, tables created, function module used, authorization checking, etc). Please be reminded to put result of "program extended syntax check" (tcode: slin) and "run time analysis" (tcode: se30) if applicable.
    4. And initial code review must made also. If proper ABAP coding is incorporated and obliged by the program. If the proper naming convention that you implemented is followed by the program...so on and so forth.
    hope you'll get some ideas out of it.
    cheers,

Maybe you are looking for