users@glassfish.java.net

RE: Glassfish Oracle Mystery

From: Kenneth Clark <kenneth.clark_at_skyetech.co.za>
Date: Mon, 29 Oct 2007 23:01:06 +0200

<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10
" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="oracle.jdbc.pool.OracleConnectionPoolDataS
ource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false
" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="OracleDS" non-transactional-c
onnections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seco
nds="0" wrap-jdbc-objects="false">
      <description>Connection to the Number Allocation Database</description>
      <property name="URL" value="jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx "/>
      <property name="Password" value="X"/>
      <property name="User" value="X"/>
    </jdbc-connection-pool>

________________
Thanks and regards

Kenneth Clark
Solutions Engineer


Tel: 27 11 679 3075
Mobile: 27 (0) 84 583 1348
Email: kenneth.clark_at_skyetech.co.za
Website: http://www.skyetech.co.za


-----Original Message-----
From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
Sent: 29 October 2007 22:42
To: users_at_glassfish.dev.java.net
Subject: Re: Glassfish Oracle Mystery

Can you post your connection pool settings from the domain.xml?

thanks,
-marina

Kenneth Clark wrote:
> Unless there is something wrong with the oracle connection pool, if
> persist is committed, the update is no different from a provider perspective.
>
> This is exactly my point, how can one work and not the other?! Has anyone experienced any funny issues with the oracle JDBC? Is there some tweak I am missing in the connection pool? This has got me climbing walls!
>
> I am at my wits end. I am going to install a new instance of glassfish and check if someone has trashed some setting somewhere.
>
> The object is updated in the pool, but the changes are not committed to the database. I call merge to update an existing object, which it does. It just doesn't commit the changes to the database.
>
> Any further feedback would be great
> ________________
> Thanks and regards
>
> Kenneth Clark
> Solutions Engineer
>
>
> Tel: 27 11 679 3075
> Mobile: 27 (0) 84 583 1348
> Email: kenneth.clark_at_skyetech.co.za
> Website: http://www.skyetech.co.za
>
>
> -----Original Message-----
> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
> Sent: 29 October 2007 22:32
> To: users_at_glassfish.dev.java.net
> Subject: Re: Glassfish Oracle Mystery
>
> As you can imagine - it's close to impossible: basic TCK tests will fail if
> merge doesn't work.
>
> Can you describe this a bit more? A persist call on an existing object should
> fail. Does it mean that you call merge to insert, but it's actually doing an
> update? Unless there is something wrong with the oracle connection pool, if
> persist is committed, the update is no different from a provider perspective.
>
> Regards,
> -marina
>
> Kenneth Clark wrote:
>
>>The only thing that seems to work is
>>1) Find the object em.find
>>2) manually set the updates on the object
>>3) then call em.persist with the new object.
>>
>>This to me seems to invalidate the em.merge and leave it pointless
>>
>>________________
>>Thanks and regards
>>
>>Kenneth Clark
>>Solutions Engineer
>>
>>
>>Tel: 27 11 679 3075
>>Mobile: 27 (0) 84 583 1348
>>Email: kenneth.clark_at_skyetech.co.za
>>Website: http://www.skyetech.co.za
>>
>>
>>-----Original Message-----
>>From: Kenneth Clark [mailto:kenneth.clark_at_skyetech.co.za]
>>Sent: 29 October 2007 22:09
>>To: users_at_glassfish.dev.java.net
>>Subject: RE: Glassfish Oracle Mystery
>>
>>That sql is consistent with that data structure and it is the only query being called at that time.
>>
>>
>>________________
>>Thanks and regards
>>
>>Kenneth Clark
>>Solutions Engineer
>>
>>
>>Tel: 27 11 679 3075
>>Mobile: 27 (0) 84 583 1348
>>Email: kenneth.clark_at_skyetech.co.za
>>Website: http://www.skyetech.co.za
>>
>>-----Original Message-----
>>From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM] On Behalf Of Sahoo
>>Sent: 29 October 2007 14:15
>>To: users_at_glassfish.dev.java.net
>>Subject: Re: Glassfish Oracle Mystery
>>
>>You have to tell if the update query looks correct as per the data you
>>are trying to update. Secondly, is that the only query sent to the
>>database? If yes, how come the changes are lost?
>>
>>Thanks,
>>Sahoo
>>
>>Kenneth Clark wrote:
>>
>>
>>>Thanks for that, after I asked the question I recoiled in horror at my stupidity and upped the log level and received the following output:
>>>
>>>[#|2007-10-29T11:41:57.838+0200|FINE|sun-appserver9.1|oracle.toplink.essentials.session.file:/usr/local/glassfish2/domains/domain1/applications/j2ee-modules/STT_AX_Services/-ax_ps0
>>>1.sql|_ThreadID=22;_ThreadName=httpSSLWorkerThread-8081-1;ClassName=null;MethodName=null;_RequestID=d7ba1f08-398c-405d-b078-43009ff35399;|UPDATE PRODUCT SET DESCRIPTION = ?, CODE =
>>>? WHERE (ID = ?)
>>> bind => [Description1, Code1, AD0935F6-0089-08D4-0A1C-3411D785F931]|#]
>>>
>>>[#|2007-10-29T11:41:57.843+0200|FINER|sun-appserver9.1|oracle.toplink.essentials.session.file:/usr/local/glassfish2/domains/domain1/applications/j2ee-modules/STT_AX_Services/-ax_ps01.transaction|_ThreadID=22;_ThreadName=httpSSLWorkerThread-8081-1;ClassName=null;MethodName=null;_RequestID=d7ba1f08-398c-405d-b078-43009ff35399;|TX beforeCompletion callback, status=STATUS_ACTIVE|#]
>>>
>>>[#|2007-10-29T11:41:57.843+0200|FINER|sun-appserver9.1|oracle.toplink.essentials.session.file:/usr/local/glassfish2/domains/domain1/applications/j2ee-modules/STT_AX_Services/-ax_ps
>>>01.transaction|_ThreadID=22;_ThreadName=httpSSLWorkerThread-8081-1;ClassName=null;MethodName=null;_RequestID=d7ba1f08-398c-405d-b078-43009ff35399;|begin unit of work commit|#]
>>>
>>>[#|2007-10-29T11:41:57.845+0200|FINER|sun-appserver9.1|oracle.toplink.essentials.session.file:/usr/local/glassfish2/domains/domain1/applications/j2ee-modules/STT_AX_Services/-ax_ps01.transaction|_ThreadID=22;_ThreadName=httpSSLWorkerThread-8081-1;ClassName=null;MethodName=null;_RequestID=d7ba1f08-398c-405d-b078-43009ff35399;|TX afterCompletion callback, status=COMMITTED|#]
>>>
>>>So it appears to have committed but when I refresh the rows in the database the changes are not there. Again, the persist mechanism is working, it is just the merge that is giving problems.
>>>
>>>________________
>>>Thanks and regards
>>>
>>>Kenneth Clark
>>>Solutions Engineer
>>>
>>>
>>>Tel: 27 11 679 3075
>>>Mobile: 27 (0) 84 583 1348
>>>Email: kenneth.clark_at_skyetech.co.za
>>>Website: http://www.skyetech.co.za
>>>
>>>
>>>-----Original Message-----
>>>From: Sankara.Rao_at_Sun.COM [mailto:Sankara.Rao_at_Sun.COM]
>>>Sent: 29 October 2007 11:46
>>>To: users_at_glassfish.dev.java.net
>>>Subject: Re: Glassfish Oracle Mystery
>>>
>>>Kenneth Clark wrote:
>>>
>>>
>>>
>>>>Ok n00b time. How do I configure the persistence.xml to display the queries?
>>>>
>>>>
>>>
>>>>From the FAQ link, Sahoo sent in his earlier mail:
>>>/Q. How do I configure the logging level for Toplink?/
>>>
>>>For both Java SE and EE, You can set the logging level for a persistence
>>>unit by using the following property:
>>>
>>><property name="toplink.logging.level" value="%DESIRED_LOGGING_LEVEL"/>
>>>
>>>In GlassFish, you can set the global log level for all the persistence
>>>units using the admin GUI or asadmin CLI. The value specified in
>>>persistence.xml overrides the global log level. Please read
>>>https://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html#Logging
>>>for more details.
>>>
>>>/Q. How can I see the sql generated by Toplink Essentials?/
>>>
>>>Set the logging level to *FINE* to see the sql generated by Toplink
>>>Essentials.
>>>
>>>
>>>
>>>
>>>>________________
>>>>Thanks and regards
>>>>
>>>>Kenneth Clark
>>>>Solutions Engineer
>>>>
>>>>
>>>>Tel: 27 11 679 3075
>>>>Mobile: 27 (0) 84 583 1348
>>>>Email: kenneth.clark_at_skyetech.co.za
>>>>Website: http://www.skyetech.co.za
>>>>
>>>>
>>>>-----Original Message-----
>>>>From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM] On Behalf Of Sahoo
>>>>Sent: 29 October 2007 10:40
>>>>To: users_at_glassfish.dev.java.net
>>>>Subject: Re: Glassfish Oracle Mystery
>>>>
>>>>1. Run your original code, i.e., *without* getTransaction().begin() and
>>>>commit. Since you are using an injected entity manager, you mst not use
>>>>getTransaction().begin() or commit().
>>>>
>>>>2. See what SQL is being issued by TopLink Essential. You can configure
>>>>your persistence.xml [1], redeploy and rerun to see the SQL.
>>>>
>>>>Sahoo
>>>>
>>>>[1]
>>>>https://glassfish.dev.java.net/javaee5/persistence/persistence_faq.html#45
>>>>
>>>>Kenneth Clark wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>There is nothing in the log file other than “Cannot use an EntityTransaction while using JTA.” When I try using the em.getTransaction.
>>>>>
>>>>>I am not understanding what you mean by "what sql is being run" as I am using the entity manager to persist the data and update the data.
>>>>>
>>>>>The scenario is as follows. Frontend populates objected to be merged, is passed back to the webservice, the webservice calls em.merge(object) and then the frontend requests a list of those specific objects. The returned list reflects the changes but the database does not. Hence my conclusion that the transaction is not being committed.
>>>>>
>>>>>I noted this behavior on Postgres and resolved it by using em.getTransaction().begin() and commit()
>>>>>
>>>>>________________
>>>>>Thanks and regards
>>>>>
>>>>>Kenneth Clark
>>>>>Solutions Engineer
>>>>>
>>>>>
>>>>>Tel: 27 11 679 3075
>>>>>Mobile: 27 (0) 84 583 1348
>>>>>Email: kenneth.clark_at_skyetech.co.za
>>>>>Website: http://www.skyetech.co.za
>>>>>
>>>>>
>>>>>-----Original Message-----
>>>>>From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM] On Behalf Of Sahoo
>>>>>Sent: 29 October 2007 08:51
>>>>>To: users_at_glassfish.dev.java.net
>>>>>Subject: Re: Glassfish Oracle Mystery
>>>>>
>>>>>With your *original* code, what SQL statements are executed when you run
>>>>>your program? That might give a clue.
>>>>>Also, are there any exceptions in the log file?
>>>>>
>>>>>Thanks,
>>>>>Sahoo
>>>>>
>>>>>Kenneth Clark wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Nope, still nothing.
>>>>>>
>>>>>>I removed the em.getTransaction and added the em.flush() below the em.merge() and it is not committing the transactions. It is mind boggling because the em.persist is working but the em.merge does not!?!
>>>>>>
>>>>>>Any further ideas?
>>>>>>
>>>>>>________________
>>>>>>Thanks and regards
>>>>>>
>>>>>>Kenneth Clark
>>>>>>Solutions Engineer
>>>>>>
>>>>>>
>>>>>>Tel: 27 11 679 3075
>>>>>>Mobile: 27 (0) 84 583 1348
>>>>>>Email: kenneth.clark_at_skyetech.co.za
>>>>>>Website: http://www.skyetech.co.za
>>>>>>
>>>>>>
>>>>>>-----Original Message-----
>>>>>>From: glassfish_at_javadesktop.org [mailto:glassfish_at_javadesktop.org]
>>>>>>Sent: 28 October 2007 04:41
>>>>>>To: users_at_glassfish.dev.java.net
>>>>>>Subject: Re: Glassfish Oracle Mystery
>>>>>>
>>>>>>em.getTransaction() is intended for Java SE environment. You shouldn't use em.getTransaction() in your session beans. Your session bean by default uses container managed transaction so each business method already executes in the context of a JTA transaction. If this method is invoked via its webservice endpoint, the container will wrap the method body with a transaction. Not sure why the tx is not committed. You may want to try add a em.flush() after merge, though it is not really needed.
>>>>>>
>>>>>>-cheng
>>>>>>[Message sent by forum member 'cf126330' (cf126330)]
>>>>>>
>>>>>>http://forums.java.net/jive/thread.jspa?messageID=242512
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>>
>>>>>>No virus found in this incoming message.
>>>>>>Checked by AVG Free Edition.
>>>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>>>
>>>>>>
>>>>>>No virus found in this outgoing message.
>>>>>>Checked by AVG Free Edition.
>>>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>>>
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>>No virus found in this incoming message.
>>>>>Checked by AVG Free Edition.
>>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>>
>>>>>
>>>>>No virus found in this outgoing message.
>>>>>Checked by AVG Free Edition.
>>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>>No virus found in this incoming message.
>>>>Checked by AVG Free Edition.
>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>
>>>>
>>>>No virus found in this outgoing message.
>>>>Checked by AVG Free Edition.
>>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>No virus found in this incoming message.
>>>Checked by AVG Free Edition.
>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>
>>>
>>>No virus found in this outgoing message.
>>>Checked by AVG Free Edition.
>>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>No virus found in this incoming message.
>>Checked by AVG Free Edition.
>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>
>>
>>No virus found in this outgoing message.
>>Checked by AVG Free Edition.
>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>No virus found in this incoming message.
>>Checked by AVG Free Edition.
>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>
>>
>>No virus found in this outgoing message.
>>Checked by AVG Free Edition.
>>Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58
 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.12/1097 - Release Date: 2007/10/28 13:58