ejb « Database « JSP-Servlet Q&A





1. Designing a website using J2EE components... JSP+Servlets+EJB+MySQL... Please guide what all concepts are needed to draw a good and attractive website    stackoverflow.com

I am in position of designing a website now, purely in Java using J2EE components mentioned in the title.. I have designed the Business Logic for my project using J2SE.. and now ...

2. Calling to a database directly through servlet vs using an EAO and EJB intermidiary    stackoverflow.com

I'm displaying text and xml on a webpage through a servlet. The servlet just loads the HTML/XML to the page on load through calls in the getPost() method. Now that ...

5. EJB3.0 transactions    coderanch.com

Thanks for your reply, Just to verify your answer by example, is this correct, Suppose one EJB1 method1 is calling EJB2 method2. Method1's transactions attribute is requires new and method2's trasnaction attribute is also requires new. My understanding is that method's one transaction will be suspended and method2 will be started in a new transaction. Is this correct? Thanks Mark.

6. EJB3.0 and Stored Procedure    coderanch.com

What is the advantage of using Stored Procedure over EJB3.0?.We are calling Stored procedure using Native Query method.In EJB3.0 Framework already having persistent mechanism over tables like em.persist(obj),em.merge(obj),etc.I am concerned that by using native query method bypassing the persistence support provided by the EJB3 framework.So What is the different between native queries and Persistent mechanism?Can any one please elobrate.

7. EJB using Stored Procedure?    coderanch.com

Everything about developing software is not on a "web site" waiting for you to find it with a ?oogle search. If you learn about how to implement the Data Access Object design pattern and know how to program Enterprise JavaBeans, then you should not have any problem with executing a stored procedure from an Enterprise JavaBean. Below is a guide to ...

8. EJB Transactions    coderanch.com

9. Caching EJB stored procedure calls.    coderanch.com

We have an application that is using a stateless session bean to call a stored procedure using straight JDBC. Sesson bean calls a class which has connection = getDataSource().getConnection(); Proc = connection.prepareCall(spString); rs = proc.executeQuery(); The problem is that the none of the data retrieved by the SP is cached at the JVM level. All calls result in a round trip ...





10. Problems understanding EJB transactions and isolation    coderanch.com

Hello, I've started to play a little bit around with EJBs 3 some days ago. Things have seemed to be pretty straight-forward to me until I've stumbled accross the following problem with the transactions/isolation concept of EJB: I have some kind of simple stateless session bean, like the following: @Stateless public class TestBean implements TestRemote { /** * The entity manager ...

11. How to programmatically find if EJB is operating in transaction mode    coderanch.com

Hi, I've an MDB which can be configured to run in either transactional or not-transactional mode at the container level. This is defined in the deployment descriptor with the trans attribute or "Required" or "NotSupported" The relevant snippet from the deployment xml is as follows MyMDB onMessage javax.jms.Message Required/NotSupported Within the onMessage method ...

12. CMT EJB 2.1 Transaction Problems    coderanch.com

13. EJB3 & Mysql + Multiple Schema    coderanch.com

Hi Ranchers, I wondered if perhaps anybody has an opinion on the following problem. I have an EJB3 setup that services the needs of a customer. This means I have one EJB3 app deployed that connects to a MySQL database schema. However, lets imagine I have 1000 customers. Each customer will have their own MySQL schema, although structually they are identical. ...

15. EJB3 and Stored Procedures    coderanch.com

I have written a single table EJB 3 code and it works perfectly fine with the basic CRUD operations. Now i want to enhance this code by calling Stored procedures but I'm not too sure how to go about it. I used Eclipse ganymede as IDE and use 'JPA Tools' plugin to create the Entities. Since my Stored Proc has sqls ...





19. Breaking up transaction in EJB's    coderanch.com

Hello Ahmed, I am brainstorming here so I am not sure if this would work, but what about using MDB the returns confirmation if sub-transactions succeed. so the main EJB starts sending messages to different MDBs and check the confirmation of each. but this sounds like your EJB will be doing a lot of management on its own, in other words ...

20. Transaction through EJB3    coderanch.com

22. EJB 3.0 Transaction Timeout annotation    coderanch.com

24. transaction in EJB 2    coderanch.com

25. EJB and Transaction    coderanch.com

What difference did you see when you tried it out yourself? Basically >executing a bean method within an already exisitng transaction This would be a bean whose transaction attribute may be supports or required. You throw a SystemException or call the setRollBackOnly and the original transaction is rolled back. >transaction and within a new transaction by suspending already running client's transaction. ...

26. EJB3 noob and User Managed Transaction    coderanch.com

Hi all, i'm a noob in ejb in general, i'm trying to use transactions. I have the following code: @Stateful(mappedName="Movements") @TransactionManagement(TransactionManagementType.BEAN) public class MovementBean { @PersistenceContext private EntityManager em; @Resource private UserTransaction ut; public boolean insert(Object obj) throws Exception { boolean result = false; try{ ut.begin(); em.persist(obj); ut.commit(); result = true; }catch(Exception e){ ut.rollback(); throw e; }finally{ return result; } } ...

27. EJB3 (JBoss 5) Problem with Persistence Context / Transaction    coderanch.com

I am experimentig with JPA and I have difficulties to reproduce an example taken from JavaMagazin 9/09 about the ECB Pattern. JBoss 5.1.0 GA, MySQL 5.0 The "boundary" (facade) @Stateless public class OrderServiceBean implements OrderService { @EJB DeliveryService deliveryService; @EJB Warehouse warehouse; @TransactionAttribute(TransactionAttributeType.REQUIRED) public Order order(Order newOrder) throws BillingException { Order order = warehouse.checkout(newOrder); deliveryService.deliver(order); return order; } } The Warehouse ...

28. How to Achive Transaction Concurrency in EJB 3    coderanch.com

Hello Udaya Welcome to JavaRanch. That's the optimistic locking feature which can be used to prevent inappropriate usage of concurrent updates over an entity in the database. Simply you can use this @Version annotation to annotate a property of a primary entity. @Version protected int getVersion(){ ... } Now, the version property manages a version value for the given entity in ...

29. EJB Transaction Problem    coderanch.com

Hi, I am trying to persist a data by using EntityManager.persist method. I am using EJB 3.0 Stateless Session Facade Bean and its transaction is Container-Managed. (CMP) After persist operation, within the same ejb method, I am trying to update the data by using a JDBC "Update" query. But the problem is that the data is not updated. The transaction is ...

32. multithreaded and transactional EJB System - a greenhorn's question    coderanch.com

Hi guys, I'm just starting to study EJB, by reading the Enterprise JavaBeans 3.0 book. Actually, I'm doing this because in the near future I plan to use this technology in my company. Today, we have an application that accesses N FTP servers and downloads files for the N corresponding local directories. It does uploads as well. Each of the FTP ...

33. EJB Transaction Attribute    coderanch.com

34. Question about Transactions in EJB / MDB scenario    coderanch.com

Hi, I have got the following question about EJB 2.1 concerning Container- and Bean-managed transactions (CMT / BMT). We use WAS 6.1 for deployment and Oracle 10g as database, but I assume this does not matter... ----------------------------------------------------------------------------------------------- Here is the scenario: A MDB (Container-managed + transaction required specified) receives a message from a queue and then calls an operation of a ...

37. EJB local injection and transactions    coderanch.com

Hello, I'm developing a JavaEE6 application, and I need to communicate two EJBs, one in the business tier and the other in the persistence tier. The persistence EJB doesn't deal with a model, it just queries a chaotic database running on SQL Server 2005, but I use an EntityManager so I don't have to worry about transactions anyway ;) So the ...

38. Convert this SQL to EJB QL    coderanch.com

40. Regarding understanding of EJB Container Managed Transaction Attributes    coderanch.com

Thanks Paul . That was really usefull and as far as my knowledge is concerned we will go for JTA only concerned only when we are using multiple Resources (For example different DataBases ) . So in normal projects JTA would not be applicable . correct me if i am wrong . Please reply . Thanks in advance.

43. EJB Transaction    coderanch.com

45. EJB 3.0 Nested Transaction Issue    coderanch.com

46. Default EJB transaction attribute    coderanch.com

47. EJB Transactions Question    coderanch.com

49. Transaction management in EJB?    coderanch.com

Excellent question, I'm not sure about the original implementation of the JDBC classes, but I bet they're not transactional. The implementation of entity manager in application servers compliance with JEE are required to make them transactional, I'm not sure if this is the same while using JPA in desktop clients. However, what you need to keep in mind is that being ...

50. JDBC transactions in EJB 2.0    coderanch.com