Daily Archives

Articles indexed Monday June 14 2010

Page 18/108 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • NonUniqueObjectException during DAO integration test?

    - by HDave
    I have a JPA/Hibernate application and am trying to get it to run against H2 and MySQL. Currently I am using Atomikos for transactions and C3P0 for connection pooling. Despite my best efforts my DAO integration tests are failing with org.hibernate.NonUniqueObjectException. I do tend to re-use the same object (same ID even) over and over for all the different tests and I am sure that is the cause, but I can see in the logs that Spring Test and Atomikos are clearly rolling back the transaction associated with each test method. I would have thought the rollback would have also cleared the persistence context too. On a hunch, I added an a call to dao.clear() at the beginning of the faulty test methods and the problem went away!! Rollback doesn't clear the persistence context...hmmm.... Not sure if this is relevant, but I see a possible autocommit setting problem in the log file: [20100613 23:06:34] DEBUG [main] SessionFactoryImpl.(242) | instantiating session factory with properties: .....edited for brevity.... hibernate.connection.autocommit=true, ....more stuff follows Because I am using connection pooling, I figure that Hibernate is where I'll have to indicate I want autocommit off. I found the autocommit property documented here and I put it in my EntityManagerFactory config as follows: <bean id="myappTestLocalEmf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="myapp-core" /> <property name="persistenceUnitPostProcessors"> <bean class="com.myapp.core.persist.util.JtaPersistenceUnitPostProcessor"> <property name="jtaDataSource" ref="myappPersistTestJdbcDataSource" /> </bean> </property> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true" /> <property name="database" value="$DS{hibernate.database}" /> <property name="databasePlatform" value="$DS{hibernate.dialect}" /> </bean> </property> <property name="jpaProperties"> <props> <prop key="hibernate.transaction.factory_class">com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory</prop> <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop> <prop key="hibernate.connection.autocommit">false</prop> <prop key="hibernate.format_sql">true"</prop> <prop key="hibernate.use_sql_comments">true</prop> </property> </bean>

    Read the article

  • starting subactivity for the second time causes java.lang.OutOfMemoryError

    - by Zacherl
    Hi there, I am developing a simple app which does a little bit of image-processing. It's divided in two activities; the main one with some display elements and the second one which is used to capture images off the phone's camera. To discribe my problem: I start the app, capture an image (by starting a new Intent with the subactivity) and all data is displayed correctly. If I capture another image after this, I run in an java.lang.OutOfMemoryError - bitmap size exceeds VM budget I dont store the captured bitmap, in the second activity I just extract some data from it and pass it to the main-activity; finishing (finish()) the sub-activity afterwards. I really dont know what I can do about it. Thanks in advance! greetings, Zacherl PS: It is my first approach to android, so I apologize for any stupid beginner error I did; if someone needs any further information, I would be happy to provide it.

    Read the article

  • Fortran bus error on mac

    - by SteveJ
    The following Fortran code is giving me a bus error on my Mac but no errors when I run it on my Linux machine: PROGRAM TINY WRITE(UNIT=*, FMT=*) 'Hello, world!' END My understanding is that a bus error occurs when the program attempts to access impossible memory but I do not understand where such an attempt has been made in this program. My MacBook has GCC 4.4.0 and my Linux machine has GCC 4.3.2. Any ideas as to why this error occurs?

    Read the article

  • Rails Nested Attributes, Relationship for Shared or Common Object

    - by SooDesuNe
    This has to be a common problem, so I'm surprised that Google didn't turn up more answers. I'm working on a rails app that has several different kinds of entities, those entities by need a relation to a different entity. For example: Address: a Model that stores the details of a street address (this is my shared entity) PersonContact: a Model that includes things like home phone, cell phone and email address. This model needs to have an address associated with it DogContact: Obviously, if you want to contact a dog, you have to go to where it lives. So, PersonContact and DogContact should have foreign keys to Address. Even, though they are really the "owning" object of Address. This would be fine, except that accepts_nested_attributes_for is counting on the foreign key being in Address to work correctly. What's the correct strategy to keep the foreign key in Address, but have PersonContact and DogContact be the owning objects?

    Read the article

  • How to change file contents in PHP ?

    - by Misha Moroshko
    I save in a file some info about users (like number of times user passed the login page, last visited time, and so on). I want to read this info from the file, and update it (add 1 to the counter, and change the last visited time). My question is: can I do it without opening the file twice ? I open the first time to read the contents, and then open it again to overwrite the contents with the updated ones. Thanks !

    Read the article

  • NFS or GFS for LVS 10 Server Setup

    - by Michael Robinson
    Currently we have a 10 servers LVS hosting setup. The people we hired to set it up did not anything about GFS which was our preferred Central Storage File System Solution. As we have tight time constraint, we just told them to use whatever they were familiar with which is NFS. I have since done some research and it seems that NFS is not ideal for the type of high traffic site we are hoping to build. I couldn't find much info online about the signaficance differences between the 2. As we to setup all servers again right now, should we stick with NFS or find someone who knows how to setup GFS amd go with that. We need a setup that is highly reliable and scalable as we intend. As after initial setup is done, we expect high increases in traffic and load.

    Read the article

  • Adobe annonce la disponibilité du runtime AIR 2, une solution multiplateforme encore plus performant

    Mise à jour du 14.06.2010 par Katleen Adobe annonce la disponibilité du runtime AIR 2, une solution multiplateforme encore plus performante Adobe vient de présenter la version 2 de son moteur AIR, qui permet à des applications écrites avec différents langages (HTML, CSS, JavaScript, ActionScript d'Adobe ; une version récente du webkit offre le support de certaines parties des CSS3 et de certaines fonctions HTML5) de fonctionner à l'identique sur Mac OS X, Windows et Linux (et même Android). Une solution multiplateforme dont le moteur JavaScript serait deux fois plus rapide, et qui réduirait de 30% la consommation mémoire des applications AIR s'appuyant sur le framework flex et tournant avec cette ver...

    Read the article

  • Oracle Cloud Computing Summit? 6/15 ?·????????????

    - by kiyoshi.nira
    ????·???????????????????????????????????????????????????????????????????????????????????????????????????·??????????????????? ??????????? ?? : 2010?6?15?(?) 10:00~16:30(????:9:30~) ?? : ?·???????????? (map) ?105-8563 ????????4-8-1 ?? : CIO?????????????IT??????????????????????????????????? ???: ??(?????) ??????????? -> Oracle Cluod computing Summit

    Read the article

  • Shift browser contents to the left while viewing in wide screen

    - by Sathya
    I use a widescreen laptop. Many websites have their content centre aligned. On wider screens this means lot of empty space on left and right. As such this is not a botheration. Many a times, I read some instructions on the web page and type them out on the command prompt. I prefer to overlay the command prompt window on top of the browser and if the browser contents are left aligned (or right aligned), then I need not Alt-tab across these windows. I use Firefox on Ubuntu. I use the command line (konsole) heavily. I know compiz (and similar) tools provides transparent windows so that the content beneath is visible. But I don't want to install compiz or its equivalent because my graphics driver is not all that good. Any addon or simple trick that would shift the page content to the left (or right) would be very helpful (read productive).

    Read the article

  • JSF ui:repeat and f:ajax giving wrong value for h:inputText after rerender.

    - by Andrew
    I have a list of questions and I can display them ok using a ui:repeat, but after clicking the Edit button the rerendered inputText is given the wrong question.id. For some reason, if you click Edit on the first item, the inputText value assigned is that of the second item in the list, even though other outputs (other than the h:inputText element) are correct. <h:form id="questionnaireForm"> <ui:repeat value="#{ProjectManager.currentProject.preQuestions}" var="question" varStatus="current" id="preQuestionsRepeat"> <div> <ui:fragment rendered="#{!question.editing}"> <f:ajax render="@form"> <p>#{question.id} #{question.questionText}</p> <h:inputText value="#{question.id}"/> <h:commandLink styleClass="link" action="#{question.setEditing}" value="Edit"> </h:commandLink> </f:ajax> </ui:fragment> </div> <div> <ui:fragment rendered="#{question.editing}"> <f:ajax render="@form"> <p>#{question.id} #{question.questionText}</p> <h:inputText value="#{question.id}"/> </f:ajax> </ui:fragment> </div> </ui:repeat> </h:form> Obviously I don't really want to edit the id. I just want the correct question.something to show up in my inputText :-) Perhaps I'm not using correctly? It seems fine according to my reading so far. Many thanks for your assistance.

    Read the article

  • best JavaScript Editor and debugger

    - by KiNGPiN
    JavaScript editors namely Komodo Eclipse (if it has any) Netbeans Antechinus® JavaScript Editor which one is best or proffered in by experience programmers, i am completely new to JavaScript and php so have no idea of which one to choose :s or if there are any other do tell please PS: also heard that many use Fireug for debugging

    Read the article

  • How to print string in this way

    - by xRobot
    For every string, I need to print # each 6 characters. For example: example_string = "this is an example string. ok ????" myfunction(example_string) "this i#s an e#ample #string#. ok ?#???" What is the most efficient way to do that ?

    Read the article

  • Spring integration with RabbitMQ

    - by Albert
    We have build a solution based on file based delivery using Spring-Integration. This works fine but we need to process many files. We are happy with Spring Integration but we want to scale up. For this we'd like to use a messaging system like Rabbit MQ(or other solutions). Does anybody have experience with this, what's needed to get this working?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >