dev@glassfish.java.net

Re: PU with TX Type JTA

From: Lance J. Andersen <Lance.Andersen_at_Sun.COM>
Date: Mon, 18 Jun 2007 16:35:09 -0400

Arun Gupta wrote:
>> http://weblogs.java.net/blog/ss141213/archive/2005/12/introduction_to.html
>> as this is a simple servlet that Sahoo created.
> persistence.xml in the blog is:
>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> version="1.0">
> <persistence-unit name ="em1"/>
> </persistence>
>
> This is very different from the one generated by default now. Does it
> seem right ?
Well when the article was written, the NB support for persistence was
not there.
>
>>>> http://weblogs.java.net/blog/lancea/archive/2007/06/using_java_web.html
>>>>
>>> This is a recent entry and has way too much details for HW.
>> could u please explain what HW is? Is it Home Work?
> Hello World :)
got it thanks
>
>>>
>>> Bullet#5 says "default data source jdbc/sample". This is not valid
>>> for GlassFish V2 b50/NB 5.5.1. My code is now:
>> This is the old sample default DataSource config in Glassfish.
>> jdbc/__default is what ships now.
> Hmm, I don't see any in my NetBeans :(
Yes, it appears that the persistence unit config is somewhat confusing
as i am trying to create a simple sample for u (will finish it up
tomorrow) as an NB project.

I encountered the same situation initially and somehow, do not ask me
how, it sees my GF pools. I think the this portion of NB could use some
TLC to make it more intuitive.
>
>>> oracle.toplink.essentials.exceptions.DatabaseException
>>> Internal Exception: java.sql.SQLException: Table/View 'COMPANY' does
>>> not exist.
>> I would enable logging via
>> <property name="toplink.logging.level" value="FINE"/>
> Where/How do I specify this entry ?
go to the xml view for the persistence.xml and add this with the rest of
the properties.
>
>>
>> to see what is happening at deploy time as it looks like your table
>> is not being created.
> Yes, I can see that from the error message. But what's weird is that
> I'm seeing this message during em.query and not during em.persist.
that is because you have not made tried to persist to the backend until
the commit() occurs.
>
> -Arun
>
>>
>>
>>> Error Code: -1
>>> Call: SELECT ID, CHANGE, PERCENTCHANGE, PRICE, LASTUPDATED,
>>> COMPANYNAME FROM COMPANY WHERE (ID = CAST (? AS VARCHAR(32672) ))
>>> bind => [1]
>>> Query: ReportQuery(sample.Company)
>>> at
>
>