Yair Ivan

Greenhorn
+ Follow
since Jul 13, 2008
Yair likes ...
Eclipse IDE Firefox Browser Oracle
Bogotá, Colombia
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yair Ivan



congrats .. is cool! ..
9 years ago
For example, you need in backingbean:




where the Servlet "ExportExcelServlet" is management export to excel.

Bye.
9 years ago
JSF
Hi Enrrique:

Which aplication server you used? Tomcat or JBoss ? .... are using some Datasource ?.

By.
10 years ago
Hi Jeremiah:

In this case attribute type the method is REQUIRED.
See you section "Specification of Transaction Attributes with Metadata Annotations" of the la SCBCD 5.0 Study Guide Mikalai Zaikin


http://java.boot.by/scbcd5-guide/ch09s04.html

Good lucky.
Hi:

In that case definitely have to check persistence.xml.

If you define the attribute transaction-type="JTA" also need datasource.

Try this:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">;
<persistence-unit name="LibraryApp-ejbPU" transaction-type="JTA">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<jta-data-source>jdbc/MyDataSource</jta-data-source>
<properties>
<property name="toplink.logging.level" value="INFO"/>
<property name="toplink.jdbc.user" value="nbuser"/>
<property name="toplink.jdbc.password" value="nbuser"/>
<property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/LibraryDB"/>
<property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>

See the following "TopLink JPA Persistence Unit Extensions":

http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html
Hi Dan:

@Stateless
public class LibraryServicesBean implements LibraryServicesLocal {

@PersistenceContext EntityManager em;

public void addCategory(Category cat) {
em.persist(cat);
}
}

The client (Suppose what client is managed-container) :

@EJB private LibraryServicesLocal library;

public static void main(String[] args) {

Category cat = new Category();
cat.setCategoryName("aaa");
library.addCategory(cat );
}

If persist() is called within a transaction, the insert may happen immediately, or it may be queued until the end of the transaction, depending on the flush mode. You may force the insertion manually within a transaction by calling the flush() method.

By.
Hi Celinio:

The method on which the PostConstruct annotation is applied MUST fulfill all of the following criteria:


- The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes
an InvocationContext object as defined by the EJB specification.

- The return type of the method MUST be void.

- The method MUST NOT throw a checked exception.

- The method on which PostConstruct is applied MAY be public, protected, package private or private.

- The method MUST NOT be static except for the application client.

- The method MAY be final.

- If the method throws an unchecked exception the class MUST NOT be put into service except in
the case of EJBs where the EJB can handle exceptions and even recover from them.


source:
http://www.163jsp.com/help/javaee50api/javax/annotation/PostConstruct.html

By.
Hi Ravi:

I have read the book EJB 3 in action (11.3.5 Using vendor-specific annotations and descriptors)
that these configurations are left to the vendors as proprietary features,
and they can be supported with "proprietary annotations", "proprietary deployment descriptors", or both.

For example for Oracle:

You use library:
oracle.j2ee.ejb.StatelessDeployment

Configures pooling with Oracle’s proprietary annotation:

import oracle.j2ee.ejb.StatelessDeployment;

@StatelessDeployment(
minInstances = 100, maxInstances = 500, poolCacheTimeout = 120)
@Stateless(name = "BazaarAdmin")
public class BazaarAdminBean implements BazaarAdmin {
}

Or using element in Oracle’s proprietary
descriptor (orion-ejb-jar.xml) element as follows:

<session-deployment
name = "BazaarAdmin"
tx-retry-wait = "60"
max-instances = "500"
min-instances = "100"
pool-cache-timeout = "120"
location = "BazaarAdmin">
</session-deployment>

And for example the weblogic-ejb-jar.xml deployment file contains
the WebLogic Server-specific deployment elements that determine the concurrency,
caching, and clustering behaviors of EJBs:

http://download.oracle.com/docs/cd/E13222_01/wls/docs81/perform/EJBTuning.html

As recommended in the book:
"You remember to add proprietary annotations may be dangerous for goal of portability of applications."

By.
Hi:

In this case, the client is a bean session (may be component web: JSP,Servlet,JSF, etc....) and
the services are in other projects ejb.

Sessions bean can be accessed using:

- Through JNDI lookup.
- Through dependency injection.

Dependency injection is supported only managed classes whose lifecycle is managed
by the container.
If the client is a EJB then you can use @EJB annotation o JNDI lookup,
if the client is a component web then you must ensure that are managed classes for decide
access type.

The bussines components can be in different packages.

I recommend seeing:
EJB 3 in action:
12.2.1. Accessing session beans using dependency injection.

By.
Hi.


Thanks Rodrigo for information.

I add the following items:

- In EJB 3 in Action section 6.2.5 Transaction and exception handling.
- In Entreprise JavaBeans 3.0 (O´Relly) Section 16.6 Exceptions and Transactions.

By.
Hello Niranjan:

As mentioned in previous forums, there is a big difference between the specifications 2.0 y 3.0
However, in the book "Mastering Enterprise JavaBeans 3.0" chapters 2 and 3 analyze the subject.
If you start with technology 2.0 Ideally the end of studying the industry because there applications
that still possess, "this is a value added".
I can recommend the documentation that I am using:

- Mastering Enterprise JavaBeans 3.0
- EJB ACTION
- Enterprise JavaBeans 3.0, Fifth Edition

Obviously you should certainly check "SCBCD 5.0 Study Guide" de Mikalai Zaikin.

By.
Hello Davide:


Post some links:


http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Server_Configuration_Guide/4/html/index.html

http://labs.jboss.com/file-access/default/members/jbossas/freezone/docs/Getting_Started_Guide/beta422/html-single/index.html#Starting_and_Stopping_the_Server


Davide Crudo wrote:Dear All,

I'm just starting with SCBCD preparation and got EJB3 in Action.

What kind of development environment did you set-up?
Anyone Using Jboss Developer Studio 2.1 ? or Jboss Tools under Eclipse?

Even though the theory on the book is quite clear, I would need to build
up some knowledge on setting up the server and, let's say, publish a simple
Hello World application to see how it works...

Any links?
thanks in advance!
Dave