Non jta and autocommit

i am using mysql, tomcat and toplink. how to set autocommit off?

my persistence.xml is this
<?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="SeleccionsCatPU" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<non-jta-data-source>java:comp/env/jdbc/selcat</non-jta-data-source>
<class>com.xlives.selcat.prueba.Prueba</class>
<properties>
<property name="toplink.session.customizer" value="com.xlives.system.jpa.DataSourceSessionCustomizer"/>
<property name="toplink.logging.level" value="FINEST"/>
</properties>
</persistence-unit>
</persistence>
and my customizer is this
JNDIConnector conn = (JNDIConnector)session.getLogin().getConnector();
conn.setLookupType(JNDIConnector.STRING_LOOKUP);
session.getLogin().setTransactionIsolation(DatabaseLogin.TRANSACTION_READ_COMMITTED);
my code is
EntityTransaction et = em.getTransaction();
Prueba p = new Prueba();
em.persist(p);
p = new Prueba();
em.persist(p);
Query q = em.createQuery("SELECT p FROM Prueba p");
List<Prueba> results = q.getResultList();
System.out.println(new Date());
for (Prueba a: results) {
// System.out.println(a.getFecha());
Date b = a.getFecha();
et.rollback();
after rollback the transaction the table PRUEBA has 2 more rows.

Similar Messages

  • Creating a separate transaction in both JTA and nonJTA environment

    I want to record some performance information for each call to my application and I want to write it to the database even if the transaction rolls back. The code needs to run both in a Websphere JTA context and a non-JTA context. The code I wrote works in non-JTA, but doesn't work in Websphere JTA context. How do I create an independent transaction when running in JTA context ? Would starting a new thread work, assuming that started a new JTA transaction ? Is there any other way that would have less overhead ?

    One way would be to use non-JTA data source. I am not sure that WebSphere allows that in JTA case, but you still may be able to create it and put into jndi "by hand".
    Alternatively you may try to use suspend / resume apis defined in jta spec.:
    Transaction tobj = TransactionManager.suspend();
    TransactionManager.resume(tobj);
    For more please see
    Java Transaction API (JTA)
    3.2.3 Suspending and Resuming a Transaction

  • JTA or non-JTA

    I am not sure whether i understand this right, but when should we go for JTA and when non-JTA based DS.
    Also, what would be the limitations of injection(on EM)?

    user8093550 wrote:
    I am not sure whether i understand this right, but when should we go for JTA and when non-JTA based DS.Generally you have the choice between a local-tx and an XA datasource. If you want to figure out when to use an XA datasource, now you have something more specific to search for.
    What you are probably talking about is the persistence context; my rule of thumb is: container managed transactions = use JTA, when you do simple client stuff then you don't need it. JTA becomes especially important when you start to mix transactions from different persistence units.
    Also, what would be the limitations of injection(on EM)?You'll need to be a lot more specific than that. If you mean where you can inject them, you should only inject them where you want to perform database related stuff, which will generally be in an EJB only.

  • "GR", "GR non-valuated", and "IR"?

    Dear Gurus,
    What determines whether we can change the "GR", "GR non-valuated", and "IR" indicators in the purchase order?
    Thanks...

    hi,
    Settings:
    1. PO field settings
    2. Account assignment settings
    Regards
    Priyanka.P

  • Firefox 4 freezes after i open it (keeps loading the page non-stop and i cant click or do anything

    firefox 4 freezes after i open it (keeps loading the page non-stop and i cant click or do anything, plus there is no option to report an error so i cant even get this checked and this seems to be the case on 3 different computers i use all have windows 7 32bit.

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • Communication between non SAP and SAP

    HI,
    do you have some information about communication between non SAP and ERP (WebAs) SAP System ?
    I would like to receive an xml file or xml IDoc from a Java Plattform (non SAP) into our SAP ERP System as an own defined IDoc.
    remember: we don´t have a converter like XI.
    What about using a proxy (do you have some information/blog how to use that) ?
    What about using a webservice (do you have some information/blog how to use that) ?
    What about storing the xml on the application server (do you have some information/blog how to use that) ?
    How to transform xml to IDoc ?
    other methods ?
    Thanks for your help.
    Gordon

    Here is a link to connecting MS SQL Server with SAP using Open Hub connection.
    http://msdn.microsoft.com/en-us/library/dd299430(SQL.100).aspx
    This might give you some insight into connecting with Non SAP Systems.
    I have used the information from this link to export data from SAP to MS SQL Server.
    Good Luck.
    MP.

  • Was updating my touch this morning when an error message occured, itunes became non responsive and was shut down.  My touch is locked in the itunes update mode and my computer no longer recognizes the touch.  How do I correct?

    During update, error occured and Itunes became non-responsive and shut down.  My Itouch is now locked in the itunes update screen and is no longer identified by my computer.  How do I fix this problem?

    Try this:
    DFU Mode / Unable to Update or Restore
    http://support.apple.com/kb/HT1808
    DFU Mode
    Open iTunes and Connect the iPhone to your Mac
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time
    After 10 Seconds release the Sleep/Wake Button until iTunes tells you it has Detected an iPhone in Recovery Mode...
    The Phone Screen will remain Black... Now Restore.
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • Problems working with non drop and drop frame DVCPRO HD material in project

    I am having playback problems with my non drop frame HDV material. It stutters.
    All of our projects up to this point have been shot in drop frame. During our last shoot however the Bcam was recorded in non drop. I loaded both the non drop bcam tapes as non drop and the drop frame Acam tapes as drop. All of the drop frame Acam material plays back fine in the source viewer and the timeline. The non drop Bcam material seems to randomly stutter in the source viewer, or causes the system to serve a "dropped frames warning" in the timeline.
    Is there a bug with fcp 5.1.2 about mixing non drop and drop frame material in a project. Or is this not possible? They are the same frame rate.
    I have exported the non drop clips in a drop frame timeline and re-imported them as drop frame clips - thus correcting the problem. Is this the best solution?
    All of the material was loaded thru a kona card as 1080i60 DVCPROHD 29.97
    I had no problems capturing the material as long as I used the corrrect firewire setting (ndf vs df).
    Anyone have a problem like this? I would greatly appreciate a response.
    Thanks,
    Mark

    http://bssc.sel.sony.com/BroadcastandBusiness/DisplayModel?m=10014&p=2&sp=141&id =78439
    The camera can record 60i, and 30F:
    "HDV 1080, 50i/60i/30F/25F Recording and Playback capable"
    Look at the clips...look at their frame rates. What do they say? Is one 59.94? Is the other 29.97?
    You would never need to render if you mixed NDF and DF footage. The footage runs at the same speed, on the TC numbers are different. But, you would need to render if your footage had different frame rates. LOOK AT THE CLIPS.
    Shane

  • Can the Macbook Pro non Retina and Macbook Pro Retina have their battery replaced?

    Can the Macbook Pro non Retina and Macbook Pro Retina have their battery replaced?

    Yes. You have to take the computer to the Apple store to have it replaced.
    Battery
    http://www.apple.com/support/macbookair/service/battery/

  • My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does no

    My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does not appear in the iTunes bar. what do I do?

    If MacKeeper corrupted the Recovery partition then even I underestimated its potential for damage. Garbage "cleaning" apps will cause misery but I have not found that the Recovery partition to have been affected by using MacKeeper or anything like it. I doubt that it did so, but I have learned not to underestimate the potential for such things to result in system corruption.
    Before concluding your Mac has a hardware failure, try booting OS X Internet Recovery by holding command option r on startup (three fingers). That will force your iMac to bypass the Recovery partition altogether, and convey the ability to create a new one.
    An Internet connection will be required (wired or wireless).
    At the Mac OS X Utilities screen, select Disk Utility. Select your startup volume (usually named "Macintosh HD") and click the Repair Disk button. Describe any errors it reports in red. If Disk Utility reports "The volume Macintosh HD appears to be OK" in green then you can be reasonably (though not completely) assured your hard disk is in good working order.
    Assuming the HD remains usable you can then use Disk Utility to erase it. Reinstall OS X, restore your essential software and other files, and don't reinstall the junk.

  • My I pad is non responsive, and the screen is full of coloured stripes. How do I fix that?

    My brand new I pad 2 is non responsive and the screen is blac with horizontal coloured stripes.
    How do I fix that?

    You could try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
    If that doesn't work then other things to try are a restore via your computer's iTunes, and then reset back to factory defaults. If none of them work then you may need to contact Apple.

  • Grid Control : Change Management Across Non-Prod and Prod

    All,
    I had some questions with regards to Grid Control Implementation Architechture on Prod and Non-Prod Env's
    The best practice is to configure a production Grid Control (GC) environment to monitor only production targets. This prevents nonproduction targets from adversely impacting a production environment.Another issue could be the compliance policy where in the production systems are to be isolated from Non-Production Environments.
    If this is the case then we have to have 2 GC environments , 1 for Prod and 1 for Non-Prod. In such a scenario how well can we do change management (Version control ) across the Non-Prod and Prod Environments ?
    To be more specific
    How is version control managed for Oracle builds if we have separate GC for Prod and Non-PROD? (Change Management pack / Configuration Management Packs are there but what is the real depth of these? )
    Change management for the Oracle Environments from DEV -> Test -> Pre-Production-> Production? We aim to have consist build across the environments can we achieve this if the GC is managed by Different OMS/OMR and if we have 2 separate environments how do we sync the GC environments managing PROD/NON-PROD after a change?

    This is feature is not there in 10.2
    This situation can be avoid by chagning the 9i port to 1522
    or install the GC on diffrent box

  • ECC 6.0 - Non-Unicode and BI 7.0 - Unicode any known problems?

    We are determing whether or not to do a unicode conversion during our upgrade from BW 3.5 to BI 7.0.  Our R/3 system is non-unicode and my company does not utilize languages other than English and is not expected to at any time in the near future.  This being said we are trying to determine whether or not we should go ahead and do the conversion prior to being forced to by SAP at some point in the future.  I was just hoping I could get some insight into whether there were known issues with running the two versions in conjuction with each other.
    Thanks in advance,
    John

    We have a customer running this scenario, it should be possible to do so. Just keep in mind to do extensive testing as there might be some notes which are not yet in standard ...
    Regards, Kai

  • TFS non-domain and SCVMM on domain

    Hello, Guys
    I installed TFS 2013 on machine non-domain and I installed SCVMM on machine with domain controller and now I have a little problem.
    The TFS is used for all my developer team and the QA team needs the lab management.
    What the best way to solve this? Add TFS machine on domain controller? Is there way to connect TFS Lab (non-domain) to Lab machine on domain.
    Kindly help
    Thanks...

    Hi Heloias,  
    Thanks for your post.
    Yes, we suggest you add TFS Server in the same domain. Or create the shadow account in your TFS Server machine and Lab server machine, then use the shadow account to configure Lab environment in TFS Admin Console.
    https://msdn.microsoft.com/en-us/library/dd936084.aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Benefits Declaring Smoker Non Smoker and Rates Based on Choice

    We have requirements from out Benefits department as follows: have an affidavit on the Open Enrollment page on which an employee declares non-tobacco user, tobacco user, or tobacco user but signing up for cessation program. There will be one set of rates for non-user and signing up for a cessation program, and another set of rates for tobacco use. Has anyone configured the system for the same or similar requirements? How did you do it? We use Self Service for Open Enrollment. We have no problem configuring different rates, but want to know options for configuring something to use to declare smoker and non-smoker and the mechanism for displaying only the correct set of rates depending on the choice. Thanks in advance for any ideas.
    Gay

    We can set up different rates based on this criteria and if the business agrees to provide the data before we process Opne we have no problem. But, this is not ideal for them. My question is has anyone set up a field (what field if you have?), put it on a self service page before the enrollments page and then triggered the Open life event to reprocess based on updating this field? If so, how have you done this? Are there any other ways of allowing employees to choose smoker/non smoker before they get to the enrollment page but during the self service window for Open, and then having the enrollment page reflect only the rates based on their choice? Thanks again for your help.
    Gay

Maybe you are looking for

  • Can I connect my macbookpro to ps2 with firewire?

    I keep hearing you can make a PS2 work over firewire with the macbook pro, true? if so, how?

  • Creating DVD from iPhoto Slideshow with music

    I'm trying to create a DVD of a slideshow with music that was created previously in iPhoto and then "Shared with iDVD". The .m4v file located in Pictures> iPhoto Slideshows is not accessible in iDVD. The only way I can make it work is to spend the ho

  • MySQL DataSource configuration with JBOSS

    Hi, I am using Eclipse with Lomboz and JBOSS as Application Server. I created a CMP Entity Bean and setup my MySQL Database Server including its JDBC Driver. I also configured several files like login-config.xml, standardjbosscmp-jdbc.xml, standardja

  • XSL Mapping Query

    Dear Collegues, i am  doing  Simple xsl transformation , source xml <?xml version="1.0" encoding="UTF-8"?> <!Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)> <ns0:Request xmlns:ns0="http://sap.com/xi/demo/httpxsd">      <CARRI

  • 8800 Problems, don't know if it's early 2008 or 1st Generation

    Okay I feel like an idiot! Any help would be appreciated. I just recently bought a refurb Mac Pro 3.0GHz Quad Xeon with the ATI1900X installed. I want to upgrade to the Nvidia card but I don't know how to tell if it's a 1st Generation or an Early 200