| Author |
Specifying database table names for CMP was 5.1
|
|
|
| Hello, i am a newbie in was 5.1
Where and how do i do it? Is there any xml conf file to do it like jdbosscmp-jdbc.xml in jboss?
i am using oracle 9i and i create a datasource. But i donīt know where i have to specify the map for ejb field names for database field names.
thanks in advance
| |
| Randy Schnier 2006-09-25, 1:30 pm |
| The WSAD or RAD tools provide this function.
leo wrote:
> Hello, i am a newbie in was 5.1
> Where and how do i do it? Is there any xml conf file to do it like jdbosscmp-jdbc.xml in jboss?
> i am using oracle 9i and i create a datasource. But i donīt know where i have to specify the map for ejb field names for database field names.
>
> thanks in advance
| |
|
| Thanks. Can you explain me where i have to do from ASTK (for example)?
| |
|
| this cannot be done from admin console or adding particular conf files?
| |
| Randy Schnier 2006-09-26, 1:23 pm |
| Unfortunately, ASTK does not provide the function to perform the CMP
mapping; to do that you need WSAD or RAD.
leo wrote:
> Thanks. Can you explain me where i have to do from ASTK (for example)?
| |
| Randy Schnier 2006-09-26, 1:23 pm |
| Unfortunately, no.
leo wrote:
> this cannot be done from admin console or adding particular conf files?
| |
|
| Wow!!
Well. Could you explain what I want to do with more detail
I`m migrating from jboss and I was using a datasource that i have configured in ejb-jar.xml, and web.xml:
----------------------------------------
ejb-jar.xml:
----------------------------------------
<ejb-jar>
.....
.....
<enterprise-beans>
<session>
.....
.....
<resource-ref>
<res-ref-name>jdbc/OneDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</session>
.......
</enterprise-beans>
.....
</ejb-jar>
----------------------------------------------
web.xml:
----------------------------------------------
<web-app>
.....
<resource-ref>
<res-ref-name>jdbc/OneDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
.....
</web-<app>
In admin console of was 5.1 I created a JDBC provider for oracle 9i, and a datasource (jdbc/OneDS) for this provider. Moreover, i created a j2c data authentication to asign datasource.
Here i try to deploy application and do it. Application starts but doesnīt work and when it try to access db i get next error:
com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR6022E: Error
Afther this, I supposed that i have not done the database mapping and try to do it with wasd 5.1.2.
First i imported ear with WASD 5.1.2.
Here is my doubts.What steps iīve to do and whatīs the correct order:
1_ Generate deployment code ???
2_ Generate EJB-TO-RDB MAPPINGS?? Here the name of the conexion is important?
3_ To probe it in my server i have to export it to an new ear, is it?
Thanks, and sorry my english
| |
| Randy Schnier 2006-09-26, 7:31 pm |
| My apologies, the previous posting where I said the ASTK does not
provide the CMP mapping function was incorrect. Sorry for the error.
For the following steps, refer to the WAS v5.1 InfoCenter documentation
located at
http://publib.boulder.ibm.com/infoc.../v5r1/index.jsp .
Select "WebSphere Application Server, Version 5.1.x" as the InfoCenter
to view (though I think for this material, all the editions are the same).
In the Contents section on the left-hand side of the page, expand
"Assembling", then "Applications", then "Assembly tools". This opens up
a number of topics on using the ASTK. One of the topics is "Mapping
enterprise beans to database tables" -- this covers the steps for
generating the mapping data into the EJB module.
Typically you would first perform the mapping, then use the ASTK to
generate the EJB deployment code from that mapping. The code gen step
is covered a little further down in the table of contents, under
"Generating code for EJB deployment."
The EJB specs leave the CMP mapping implementation up to individual app
server vendors; this is why the mapping needs to be performed again when
moving from other app servers to WebSphere (or vice-versa).
Hope this helps.
leo wrote:
> Wow!!
> Well. Could you explain what I want to do with more detail
>
> I`m migrating from jboss and I was using a datasource that i have configured in ejb-jar.xml, and web.xml:
>
> ----------------------------------------
> ejb-jar.xml:
> ----------------------------------------
> <ejb-jar>
> .....
> .....
> <enterprise-beans>
> <session>
> .....
> .....
> <resource-ref>
> <res-ref-name>jdbc/OneDS</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
> </session>
> .......
> </enterprise-beans>
> .....
> </ejb-jar>
>
>
> ----------------------------------------------
> web.xml:
> ----------------------------------------------
> <web-app>
> ....
> <resource-ref>
> <res-ref-name>jdbc/OneDS</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
> ....
> </web-<app>
>
> In admin console of was 5.1 I created a JDBC provider for oracle 9i, and a datasource (jdbc/OneDS) for this provider. Moreover, i created a j2c data authentication to asign datasource.
> Here i try to deploy application and do it. Application starts but doesnīt work and when it try to access db i get next error:
>
> com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR6022E: Error
>
>
> Afther this, I supposed that i have not done the database mapping and try to do it with wasd 5.1.2.
> First i imported ear with WASD 5.1.2.
> Here is my doubts.What steps iīve to do and whatīs the correct order:
> 1_ Generate deployment code ???
> 2_ Generate EJB-TO-RDB MAPPINGS?? Here the name of the conexion is important?
> 3_ To probe it in my server i have to export it to an new ear, is it?
>
>
>
> Thanks, and sorry my english
| |
|
| thanks very much,
finally i do it with WASD and now works
| |
|
| One more question,about this.
Is there any way to deploy application with ant instead of admin console(web)?
| |
| Paul Ilechko 2006-09-27, 1:22 pm |
| leo wrote:
> One more question,about this.
> Is there any way to deploy application with ant instead of admin console(web)?
Yes. See the documentation in the WAS Infocenter for details.
| |
|
| thanks.
One question. Does W.A.S execute ddl file(for table creation) when you deploy it?
I think was do it, because my db after install was empty tables.
How can i change this?
thanks
|
|
|
|