Nvarchar in Container Managed Bean.
Hi
I m using Oracle 8i with weblogic 6.1. My application has to support NLS. So, I m using NVARCHAR datatype.
When i try to insert into table using CMP, 'Characterset Type Mismatch'! Error is thrown.
Anyone can give how to solve this problem or which datatype to be used to support this.
Thanks in Advance.
Regards
RameshJayaShankar.R
Innova Solution.
[email protected]
Hi Ramesh,
A quick look at my copy of "Oracle 8i: JDBC Developer's Guide and Reference
Release 3 (8.1.7)" tells me -- in table 21-2 on page 21-5 of chapter
21 (Reference Information) -- that the NVARCHAR2 datatype is not supported
by Oracle's JDBC driver or by Oracle's SQLJ. Perhaps that is the reason
for the error message you are receiving?
Hope this helps.
Good Luck,
Avi.
Similar Messages
-
Problems while defining EJB relations for container managed bean
I am having a problem while trying to create my relations for my container managed bean.
My Database schema is:
Order table
order_id
message
WorkItem table:
order_id
item_id
message
I have defined my OrderBean to have:
@LocalMethod()
@CmrField
public abstract Collection getCmWorkItemsCmr();
@LocalMethod()
public abstract void setCmWorkItemsCmr(Collection workItems);
I am not sure how to define my relation for my class:
@Relation(cmrField = "cmWorkItemsCmr", multiplicity = Relation.Multiplicity.MANY, name = "Orders-CmWorkItems")
An order can have many workitems. I am not sure how to fill in the rest for foreign Key jointable and such.
Any help pointing me in the right direction would be helpful.
Thanks,
IanI am having a problem while trying to create my relations for my container managed bean.
My Database schema is:
Order table
order_id
message
WorkItem table:
order_id
item_id
message
I have defined my OrderBean to have:
@LocalMethod()
@CmrField
public abstract Collection getCmWorkItemsCmr();
@LocalMethod()
public abstract void setCmWorkItemsCmr(Collection workItems);
I am not sure how to define my relation for my class:
@Relation(cmrField = "cmWorkItemsCmr", multiplicity = Relation.Multiplicity.MANY, name = "Orders-CmWorkItems")
An order can have many workitems. I am not sure how to fill in the rest for foreign Key jointable and such.
Any help pointing me in the right direction would be helpful.
Thanks,
Ian -
Container managed bean persistence queries
Hi,
I want to know where the container generated java sources and
classes for the container managed beans will be sotred as i want
to look out the sql queries that is not inserting and updating
the values into the tables.
As well i want to refer how the bean persistence is handled.
thanks
kumarHi,
I want to know where the container generated java sources and
classes for the container managed beans will be sotred as i want
to look out the sql queries that is not inserting and updating
the values into the tables.
As well i want to refer how the bean persistence is handled.
thanks
kumar -
How to add a finder method in the container manager Bean in the weblogic6.1
in the environment jbuilder6 andweblogic6.1,use container manager entity Bean,it can automatic generate the findAll() method,I want to add a new method to find an element in the home interface,such as findByName(),name is a element of a table of the database.in the weblogic-cmp-rdbms-jar.xml,this is part of the fiile:
<finder>
<finder-name>findAll</finder-name>
<finder-query><![CDATA[ (= 1 1) ]]></finder-query>
</finder>
<finder>
<finder-name>findByName</finder-name>
<finder-param>java.lang.String</finder-param>
<finder-query><![CDATA[ (=name $name) ]]></finder-query>
</finder>
It can successfully compile the findAll(),but it is wrong when compile the findByName(),as follows
"www.ejbgrpx": Method Name: findByName
"www.ejbgrpx": Invalid specifications for a WebLogic RDBMS CMP EJB.
"www.ejbgrpx": ERROR: Error from ejbc: weblogic.ejb20.cmp11.rdbms.finders.IllegalExpressionException:
"www.ejbgrpx": While trying to process Finder
"www.ejbgrpx": Parameter Types: (java.lang.String)
"www.ejbgrpx": WebLogic Query: (= name $name)
"www.ejbgrpx": Finder Expressions: ()
"www.ejbgrpx": Could not parse WLQL expression: (= name $name) null
"www.ejbgrpx": ERROR: ejbc found errors
thank youThe finder methods that you are referring to are only simple finder methods. If you would like to add specialized finder methods, you can make your entity bean with bean managed persistence and not container managed. If you are using EJB 2.0, your entity bean with container managed persistence can use EJB QL for finder methods. You can search for this topic and/or download the EJB 2.0 specifications
Hope this helps -
Container-managed / bean-managed transaction demarcation
I am trying to make sure I understand container-managed and bean-managed transaction demarcation and in particular where you have one bean calling another bean. What happens where one of the beans has container-managed transaction demarcation and the other bean-managed transaction demarcation. In fact the initial question to ask is, is this allowed?
Lets use an application scenario to illustrate the issue. The application has a payment transaction. Payments can be received in one of two ways:
1. As a payment at a branch where the individual payment is processed on a client application and resulting in the processing of a single payment transaction.
2. As a batch of payments received from a bank containing, potentially, thousands of payment transactions.
The proposed implementation for this uses two session beans. The first is a Payment session bean that implements the business logic as appropriate calling entity beans to persist the change. The second is a BatchPayment session bean. This processes the batch of payment transactions received from the bank. The BatchPayment reads through the batch of payments from a bank calling the Payment session bean for each payment transaction.
Lets look at the transactional properties of both session beans. In order to support the client application the Payment session bean can implicitly enforce transactional integrity and is therefore set to container-managed transaction demarcation. However the BatchPayment session bean will want to explicitly specify transaction demarcation for performance reasons. The transactional "commit" process is relatively expensive. When processing a large batch of transactions rather than performing a commit after every transaction is processed we want to perform the commit after a number of transactions have been processed. For example, we may decide that after every 100 transactions have been processed we commit. The processing will have a shorter elapsed time as we have not had to perform 99 commit processes. So the BatchPayment session bean will want to explicitly specify its transaction demarcation and will therefore be defined with bean-managed transaction demarcation.
How would this be implemented? A possible solution is:
Payment session bean implemented with container-managed transaction demarcation with transaction scope set to Required.
BatchPayment session bean implemented with bean-managed transaction demarcation with transaction scope set to Required.
When the client application is run it calls the Payment bean and the container-managed transaction demarcation ensures the transactional integrity of that transaction.
When a BatchPayment process is run it explicitly determines the transaction demarcation. Lets say that after every 100 Payment transactions (through 100 calls to the Payment session bean) have been processed the BatchPayment bean issues a commit. In this scenario however we have mixed container-managed and bean-managed transaction demarcation. Hence my original question. Can container-managed and bean-managed transaction demarcation be mixed? If not how is it possible to implement the requirements as described above?
Thanks for any thoughts.
PaulBatchPayment session bean implemented with bean-managed transaction demarcation with transaction scope set to Required.Didn't quite understand this sentence.... if it's BMT it has no declarative transaction attributes such as "Required"....
Anyway, first of all I'll have to ask, Why at all would you want to commit in the middle of the business method? to get as much through as possible before a potential crash? :-)
Can container-managed and bean-managed transaction demarcation be mixed?Yes, of course. Just remember that the "direction" you are refering to ->
a BMT SB that propagates it's transaction to a method in a CMT SB that is demarcated with "Required" is the simplest case. If it were "reversed", or for that matter any BMT that might be called within an active transaction context must perform logic to manipulate the transaction state. For instance(and most common case), checking to see if a transaction is active and if so not to do anything(just use the one that is already active).
If not how is it possible to implement the requirements as described above?You could also implement this scenario with CMTs all the way through. your BatchPayment SB could consist of two methods, one (say, execute(Collection paymentsToExecute) ) with "Supports", and another(say executeBatchUnit(Collection paymentsToExecute, int beginIndex, int endIndex) ) with "RequiresNew".
then have the first just call the other with indexes denoting each time a group of payments.
Still, it does seem more suitable using BMT for these kind of things.....
Hope this helped.... -
Problem in retrieving value via ejb2.0 in stateless container managed bean
-----------------------ejb-jar.xml---------------------------------
<session>
<description>Entity Bean</description>
<ejb-name>Stl</ejb-name>
<local-home>com.ejb.session.ejbeans.StlHome</local-home>
<local>com.ejb.session.ejbeans.Stl</local>
<ejb-class>com.ejb.session.ejbeans.StlBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
-----------------------ejb-jar.xml---------------------------------
--------------------------------------------------StlBean---------------------------------------------------
public ArrayList setaArrList() throws RemoteException {
makeConnection();
try {
results = statement.executeQuery(aExQry);
resultsetmetadata = results.getMetaData();
int i = resultsetmetadata.getColumnCount();
totcols = i;
int j = 1;
ArrayList arr = new ArrayList();
ArrayList arrnm = new ArrayList();
while (results.next()) {
for (int k = 1; k <= i; k++) {
String s2 = resultsetmetadata.getColumnName(k);
int coltype = resultsetmetadata.getColumnType(k);
String s3 = null;
if(coltype == java.sql.Types.CLOB) {
Clob fileAsCLOB = null;
long length = 0;
fileAsCLOB = results.getClob(resultsetmetadata.getColumnName(k));
if(fileAsCLOB != null) {
length = fileAsCLOB.length();
s3 = fileAsCLOB.getSubString(1, (int) length);
} else {
s3 = results.getString(resultsetmetadata.getColumnName(k));
if (!arrnm.contains(s2)) {
s2 = setString(s2);
arrnm.add(s2);
s3 = setString(s3);
arr.add(s3);
j++;
this.x= arrnm;
public ArrayList getxArrList() throws RemoteException {
try {
return x;
--------------------------------------------------StlBean---------------------------------------------------
Problem is with getxArrList() ,We not getting the correct value of x when tested for 2 users.Re: Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0], locking.
-
BMP (Bean Managed) vs CMP (Contained Managed) Beans
Hi,
Actually this is more of a clarification question than an actual issue. To give a background, we're creating a Web Dynpro application that must be connected to an Oracle Database. However,we're in the process of deciding whether to use BMP or CMP to connect the application to the database.
However, there is a direction to use Oracle Views and Stored Procedures. Since I am new to CMP, I was wondering if this is possible in CMP beans as well.
Would like to ask if you have any suggestions on which is the better approach? Pros and cons would be helpful, and additional resources would be useful too.
Thanks!
AngeloYou are probably trapping the exception, so the container never see's it.
-
How to include Managed bean class in build sciprt for taskflow (Jdev 11.4)
Hi,
I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
Below is the oracle provide build script..
<?xml version="1.0" encoding="US-ASCII" ?>
<!--Ant buildfile generated by Oracle JDeveloper-->
<!--Generated Sep 29, 2009 11:47:41 PM-->
<project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
xmlns:wls="oracle.webcenter.tools.wls">
<property file="../config.properties"/>
<property file="build.properties"/>
<import file="internal-targets.xml"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="clean-stage"
description="Cleans the output directory and generates the war"
depends="clean, stage"/>
<target name="deploy-shared-lib"
depends="init-wls"
description="Deploy the extending WebCenter shared library">
<echo> ---------------------------- </echo>
<echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
<exec logerror="true"
executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
<!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
<arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
<!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
<!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
</exec>
<echo> ---------------------------- </echo>
<echo> Restarting the app </echo>
<echo> ---------------------------- </echo>
<exec logerror="true"
executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
<arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
</exec>
</target>
</project>
Thanks in advance
NitinHi,
I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
Below is the oracle provide build script..
<?xml version="1.0" encoding="US-ASCII" ?>
<!--Ant buildfile generated by Oracle JDeveloper-->
<!--Generated Sep 29, 2009 11:47:41 PM-->
<project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
xmlns:wls="oracle.webcenter.tools.wls">
<property file="../config.properties"/>
<property file="build.properties"/>
<import file="internal-targets.xml"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="clean-stage"
description="Cleans the output directory and generates the war"
depends="clean, stage"/>
<target name="deploy-shared-lib"
depends="init-wls"
description="Deploy the extending WebCenter shared library">
<echo> ---------------------------- </echo>
<echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
<exec logerror="true"
executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
<!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
<arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
<!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
<!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
</exec>
<echo> ---------------------------- </echo>
<echo> Restarting the app </echo>
<echo> ---------------------------- </echo>
<exec logerror="true"
executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
<arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
</exec>
</target>
</project>
Thanks in advance
Nitin -
Extreamly slow container managed persistence
Hi.
We perform the following procedure:
1. We invoke a finder method on a container managed bean
2. Then we traverse the enumeration of beans returned and invoke a getter
method to get their properties.
The finder finishes really fast, but then traversing the enumeration takes
about 1 second per entity bean.
Any suggestions?
Giora Katz-LichtensteinHi,
When you're iterating through your collection or enumeration of primary
keys, each method call is going to the database to retrieve the row
associated with that primary key. I'll bet the issue is with the calls to
the db or whatever persistent store you're using.
Steve...
Giora <[email protected]> wrote in message
news:82kolv$192$[email protected]..
Hi.
We perform the following procedure:
1. We invoke a finder method on a container managed bean
2. Then we traverse the enumeration of beans returned and invoke agetter
method to get their properties.
The finder finishes really fast, but then traversing the enumeration takes
about 1 second per entity bean.
Any suggestions?
Giora Katz-Lichtenstein -
SetRollbackOnly doesn't work on Container Managed MDB
I have a Container Managed Message Driven Bean + an AQ Queue.
In my onMessage, I call the messageContext.setRollbackOnly() but my message is removed from the queue!
Is it the expected behavior??? It seems that there is a problem with the transactions (for container managed bean)!
I am using oc4j 9.0.3 build 020725.1695 and oracle db 9.0.1.3 with the patch 2416054.
Here is ejb-jar.xml :
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>test</ejb-name>
<ejb-class>myPackage.MyMdb</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>test</ejb-name>
<method-name>onMessage</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Laurent LopezLaurent -- You cannot use "RequiresNew" as the trans-attribute for your MDB. You would use "Required". Here is an excerpt from section 15.4.7 of the EJB 2.0 spec.
The onMessage method is invoked in the scope of a transaction determined by the transaction
attribute specified in the deployment descriptor. If the bean is specified as using container-managed
transaction demarcation, either the Required or the NotSupported transaction attribute must be
used.[26]
When a message-driven bean using bean-managed transaction demarcation uses the javax.transaction.
UserTransaction interface to demarcate transactions, the message receipt that causes
the bean to be invoked is not part of the transaction. If the message receipt is to be part of the transaction,
container-managed transaction demarcation with the Required transaction attribute must be
used.
Thanks -- Jeff -
Container Managed Persistence entity bean relationship fields
I want to ask something that until now still confuse. Did Relationship fields in Container Managed Persistence entity beans declare , inside Database table or only Persistence fields .
If Relationship fields not declare inside database table ,how if SQL calls the relationship fields between related entity bean.
did container handle this task.
example: I have 2 entity bean with CMP(Container Managed Persistence)version 2.0
call Player and Team. every entity bean have own relationship fields and persistence fields.
player has playerId(primary key),name,position,age persistence fields and teams is relationship fields.
team has teamId(primary key),name,city and players is relationship fields.
I know that all persistence fields is declare in own database table but how about relationship fields.
can you tellme, How SQL calls can access relationship fields if relatiosnship fields is not declare in database table.
I use J2EE RI SDK version 1.3
and deploytool .
thank's .thank's for your reply .Now I have another problem
I use J2EE RI from java.sun .I try to follow example in j2eetutorial about CMP Example call RosterApp.ear .
I dont'change anything code inside RosterApp.ear but when I deploy and runclient command thereis syntax error :
java.rmi.ServerException: Remote exception occured in server thread :nested exception is java.rmi.ServerException :exception thrown from bean :nested exception is : java.ejb.EJBException :nested exception is :java.sql.SQLException :syntax error or access violation ,message from server: "you have an error in SQL syntax near "
"leagueBeanTable" WHERE "leagueId" = 'L1' at line 1
in example ,RosterApp.ear use Cloudscape database ,but I try to use Mysql database for RosterApp.ear ,is there any different syntax SQL from Cloudscape to Mysql .
if like that ,so I must edit first SQL calls from Cloudscape to MYSQL . I think because relationship fields is for entity beans only ,so how if mysql database want to access foreign key another table because foreign key isn't declare in databse table.
example : I have 3 entity bean call player, team, league .
1. PlayerEJB have persistence fields name, position, playerId(primary key), cmr fields is teams
2. TeamEJB have persistence fields name, city, teamId (primary key) , cmr fields is players and leagues .
3. LeagueEJB have persistence fields name ,sport, leagueId(primary key), cmr fields is teams
so table is
PlayerEJB <--->TeamEJB<--->LeagueEJB
Player have some finder method call findBySport(String Sport) .
because Sport is persistence fields for LeagueEJB
so PlayerEJB must traverse TeamEJB first before LeagueEJB
EJB QL : SELECT distinct object(p) FROM Player (p) IN (p.teams) AS t
WHERE t.league.sport = ?1
I know that Container will translates EJB QL to SQL calls ,but default is only for cloudscape database and I use for MYsql .
so can you helpme how to query method findBySport(String sport) to Mysql calls .
thereis no foreign key between table in database table there is only Relationship fields in entity bean. -
Finder method in container-managed entity bean
Finder method of a container entity bean is taking the primary key class object of another entity bean. How to map this in the xml descriptor file weblogic-cmp-rdbms.xml for this type of beans.
I am trying to deploy the jasmine computer store of Mastering EJB by EdRoman.
I couldn't write the deployment file weblogic-cmp-rdbms.xml for Order Entity bean which uses CustomerPK as an argument in its finder method.
Please tell me how to write this. I am trying on weblogic 5.1
Thanx in advance
Srivatsahello,
in container managed persistence, you specify on your xml file the name of your table. so the primary key you want to use have to be a foreign key in your table. otherwise i don't think that you can use a container managed persistence.
Najib. -
About Container-managed Transactions and Bean-managed Transactions
as the document of weblogic7.0 describe the differents of Container-managed
Transactions and Bean-managed Transactions,and in the document,It tell us
details of using Bean-managed Transactions,such as \:
import javax.naming.*;import javax.transaction.UserTransaction;.....
import java.sql.*;import java.util.*;
UserTransaction tx = (UserTransaction)
ctx.lookup("javax.transaction.UserTransaction");tx.begin();
tx.commit() //or tx.rollback
but how to use Container-managed Transactions?
what is EJB's deployment descriptor? can someone tell me?
i wonder someone will show me an example of how to use Container-managed
Transactions.
thanks
fish
Many if not all of the WLS EJB examples use container-managed
transactions. That's a good place to start.
I'd also recommend that you pick up a decent EJB book. There's several
on the market right now.
-- Rob
fish wrote:
> <ejb-jar>
> <enterprise-beans>
> <session>
> <ejb-name>testbean</ejb-name>
> <home>test.test.TestHome</home>
> <remote>test.test.Test</remote>
> <ejb-class>test.test.TestBean</ejb-class>
> <session-type>Stateful</session-type>
> <transaction-type>Container</transaction-type>
> </session>
> </enterprise-beans>
>
> <assembly-descriptor>
> <container-transaction>
> <method>
> <ejb-name>EmployeeRecord</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>Required</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
> </ejb-jar>
> ----------------------------------------------
> seems i have to write ejb-jar.xml like this,am i right?
> what about <ejb-client-jar>? is it needed in this xml file?
>
> thanks
>
> fish
>
>
-
Bean-Managed vs. Container-Managed Persistence
Hello,
I would like the real world skinny on bean-managed persistence vs. container-managed persistence. I have heard the bean-managed offers higher scalability and performance, while container-managed offers simplicity but with a cost. Can someone give me some perspective?
Thanks,
Rob MillerWrong forum, but I guess if you are new to java it could be argued that anything goes...
General rule:
use CMP if you don't have worries about speed or legacy systems.
use BMP if you need to control the persistence and/or want to connect to legacy host systems. BMP allows you to set up caching and transaction handlers to handle the presistence in a manner more suited to your needs. -
Bean or Container Managed Persistence
Hi,
I've been reading up on the Sun J2EE tutorial. One of the topics there is bean or container managed persistence. It states that container managed is easier for developers and allows for more portability. The class codes are much smaller compared to bean managed and developers need not worry about database queries.
Can anyone share their experiences on this? Any 'Real World' advantages and disadvantages? Is there a guideline I can follow when to use bean or container managed persistence?
Thanks,
-RayThat seems like an obvious flaw. So why was it even considered in the
J2EE framework? I mean wouldn't the J2EE architects immediately realize
that? Just doesn't make sense to me why there's even a tutorial or books
for it. What does it suppose to solve then??I know what you mean... again, I think they thought it looked good on paper.
And it gets worse...
Before you use Entity Beans you must be absolutely sure that there will never be another app that accesses the underlying table that doesnt use the EntityBean to do it... For example a C++ App that accesses the tables directly... otherwise you have to set a flag in the App Server that states that basically every time a property on an EntityBean is read the Bean will have to RE-READ the beans state from the database!!
Some things look really good, from an OO perspective, but dont work really well in reality. Sure Entity Beans look really good in the example program in the tutorial, but what happens when you multiply the number of entity beans by 1000, 100,000, or more? Just think of the CPU, and Memory overhead for instantiating all those objects!
There are people out there who believe that using Stored Procedures is a no-no because in their minds it puts "Business Logic" on the database and not the App Server...To this I say... BUNK... Ive seen several instances where by simply moving a set of queries from the App Server to a stored procedure on the database, allowed for a 10-20 times performance gain because of the elimination of network IO. In one instance I saw a query go from 3 hours execution time on the App Server to under 10 minutes on the database... But stored procedures arent OO...
So IMHO before you use EntityBeans at all... be absolutely sure you understand all of the ins-and-outs of doing so.
Maybe you are looking for
-
Why isn't the "Find My iPad", "Find My Mac", etc. feature not automatically enabled in the iCloud Settings on every device? My iPad was stolen a couple days ago and it's been showing Offline under "Find My iPhone" feature so I started doing some rese
-
Oracle insert speed (92k records)
I am inserting 92,000 records into oracle (nightly job) I am just trying to speed things up (is my first C#/Oracle app) at the moment, I have 2 ways of inserting the records using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; 1) command.Co
-
Jdev 10g: missing TemplateApplication.xml
Hi, Just tried jdev 10g - when starting up have two messages: 1) Missing application.xml template file <jdev_home>\mywork\config\TemplateApplication.xml 2)Missing LRAD MMD folder <jdev_home>\mywork\config\jrad What is it - a welcome type message or s
-
Installed 10.6.3 and Maya has same issues as in 10.6.1
The graph editor is no longer usable on a setup with dual monitors when the graph editor window is opened on the secondary monitor. I also found the graph editor redraw glitch to be back as well (even if it is opened on the primary monitor). It worke
-
hey guys, Is there any way to create a API wherein i can integrate the firewall with any other IPS device for e.g. an IP is detected as a high alert in IPS device, this IPS device will call an API , which will in turn block the IP on perimeter firew