transaction « Database « JSP-Servlet Q&A

2. Transaction in JSP

3. Transaction management and Security in JSP

JSP is a technology for the presentation layer; it does not address problems of transactionality and security. J2EE does, of which JSP is a small part. And that's a good thing. Many ASP sites of old used to mix all these functionalities together, with the result quite often being horrible spaghetti code. With servlets, you can move some of the security ...

4. Transactions with JSP ?

6. Refresh problem while doing transaction

Hi Friends, I wrote a program for online banking and I used mvc model 2 approach for that,I have refresh problem while doing withdrawal and deposit: First let me explain how this transaction of withdrawal takes place: In my JSP page user enters amount to be withdrawn -> control gets transfered to transactionController servlet -> Controller servlet create object of transaction ...

7. Transactions Rollback in jsp

9. Transaction rollback in ejb2.0

10. jms message ack problem in transaction

11. MDB XA Transactions Behaviour

12. transaction in jsp

Hi, I have two methods in my jsp page, which in turn call java beans, which call ejbs. I want both the methods to execute only if both of them return desired results. First method posts to a site, and the second method updates a table in the database. Now, if the post is unsuccessful, I'm not calling the update method. ...

14. transaction rollback in servlet

15. transactions across jsp pages best practice

I am creating a web application using a mvc jsp/servlet architecture. I am having a problem deciding how to maintain transaction state across multiple pages. Eg I have say three jsp pages which will each save information to separate database tables which comprise a single transaction. The problem arises when the user decides to hit the back button and goes back ...

16. Transactions in Servlet

19. FTP transaction using a servlet

I wrote a program that uploads files to a FTP server and then downloads it if necessary later on. The program is working successfully but there is a problem when i download the file. The file is an excel file and when i try to open it the following message is displayed... "The file cannot be accessed. The file may be ...

21. XA transactions Problem

HI Using OC4J i've set up a message driven bean that consumes messages from a queue(Websphere MQ). I've got a scenario whereby on rare occasions my bean won't be able to process the message due to the absence of an external service. When this happens, i roll back the transaction so the message is returned to the queue, the idea ...

23. java mail and transaction

Hi. Can Java Mail participate in a Transaction when used in the container? I mean, I send a message, then I try to store sth in the db, and it fails, and the message is never sent. Is this possible? If yes, how can one make Java Mail Session be part of a transaction? Cheers.

25. [JTA] Distributed transactions questions

Hi. I've been reading the JTA specs and also did some reading of the original OMG XA, DTP and TX specifications, and I get the idea of how this stuff works. However, I still have a few questions, any answers appreciated. 1. There are heuristic commits / rollbacks. How can this occur? I know of some that are caused by a ...

29. Context transaction and propagation.

Hi, I have a distributed application (CMT) that has a bean and calls another bean within the same scope, the bean 1 makes an insert in a table A, then the bean 2 insert another register in the same table, when I try to see the inserted row 1 by the bean 1 from the bean 2 I can not see ...

32. Regarding the Transaction suppourt when using MDB and SessionBeans

Depends wht you want to achieve, and which type of transaction management you want to use - bean or container? For exanple, if you want the message receipt be part of the same transaction as operations in the stateless bean, you use CMT on the message bean, and make the transaction context propagate to the bean. This way when the stateless ...

33. WebSphere transaction timeout

Hi All, We've been encountering an interesting scenario in WebSphere (WAS 6.1). We know the root cause for the problem in question and fixed it, and things have been working fine since then. But what we don't understand is WebSphere's behavior in the scenario. This is what our process does: 1. It is a stateless session bean that uses bean managed ...

34. Nested Transaction in JTA

36. JMS and transaction

37. Distributed transaction or local transaction

Typically local transaction are used when resources involved in transactions is unique (for instance : a database do persist information). When you need to persist informations in various and differents databases (or other resources used to persist information and involved in transaction), then you must be use distributed transactions (using JTA). JTA specifies ways to manage distributed transaction properly. Best regards, ...

38. How to identify existing Transaction?

41. how to solve the Transaction.IllegalResourceIn2PCTransactionException

Hi, Please give the solution to solve the the below error, RegisteredRes E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction LocalTransact E J2CA0030E: Method enlist caught Illegal attempt to enlist multiple 1PC XAResources at at at at Thanks in Advance.

42. Can not commit a managed transaction

Hi All, In one of our applications, a session bean whose transactions are container managed invokes a class for handling some database operations purely based on JDBC calls using a datasource. This is working fine in production every day. But some times we observed a phenomenon where in an exception was thrown mentioning that Managed transactions can not be commited explicitly. ...

45. JMS Transaction Issue

Hi, I want to implement JMS transactions while sending messages to queue. From whatever I information I got on JMS transactions, I could get that JMS transactions can be maintained at the receiving end,say 10 messages have been sent to a queue, so through a transacted session i can guarantee that the transaction will not get commited until i process all ...

46. Container Managed Transaction

47. Container managed transaction (CMT) doesn't commit transactions

Hello to the respected community. I'm working with Jboss 4.2.3 GA and Hibernate 3.3.1 GA. The Relevant Hibernate configuration file section is like this: java:toluna_mssql_jdbc com.toluna.common.hibernate.SqlServerDialect org.hibernate.transaction.CMTTransactionFactory org.hibernate.transaction.JBossTransactionManagerLookup true true after_transaction true org.hibernate.cache.EhCacheProvider true true 1 250 thread ...

48. Unable to get Transaction Manager

Hi volks i want to do a secure lookup from a standalone client Properties env = new Properties(); // Try with a login that should succeed env.setProperty(Context.INITIAL_CONTEXT_FACTORY, ""); env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/"); env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); env.setProperty(Context.SECURITY_CREDENTIALS, password); env.setProperty(Context.SECURITY_PRINCIPAL, username); env.setProperty(Context.SECURITY_PROTOCOL, "stundenplanSecurity"); try { Context ctx = new InitialContext(env); //Here i get the Exception shown below } catch (NamingException e) {} but here i get ...

49. EntityManager Transaction-Scoped/Extended-Scoped behaviour:

Mikalai Zaikin Notes says "If an entity manager with transaction-scoped persistence context is in use, the resulting entities will be DETACHED; if an entity manager with an extended persistence context is used, they will be MANAGED." Is it a typo "is in use'? Does it wants to says when transaction ends, with transaction-scoped persistence context - the resulting entities will be ...

50. MDB Transaction Propogation.

Hi Guys ,I am very new to EJB 3.0 I have deployed a EAR in a web logic 10.3 g which have two ejb modules called 1.ServicesDump 2.MessageDump In ServicesDump i have a session bean which doing the database updates,After i have deployed, When i called these remote session-bean from out side of container to test the functionalites it working perfectly(Which ...

51. MDB transaction rollback

52. Transaction timeout settings - OpenEJB

53. Transaction Boundary Problem

54. Transaction rollback

57. JMS Distributed Transactions

59. Distributed Transactions

I need to perform a distributed transaction in My Servlet. My distributed transaction involves Updating to the DB and also publishing a message to a queue. The queue is not present in my app server, where my Servlet is running. It is there on a remote machine. I'm using below code to achieve the same. But I'm not getting the transactional ...

60. Transaction Rollback problem

61. Transaction - Possible uses

62. How to rollback a transaction when transaction time out in websphere

Hi, i have a problem in my websphere environment. I set my websphere transaction timeout to : 300 sec. am locking a record in my data base and try to edit the record from my application(through the browser) browser is hanging for ever, could you please tell me why ejb is not rolling back the transaction even after crossing 300 seconds? ...

63. Transactions

64. MDBs and Transactions

65. How I can manage a transaction CMT in the JBoss?

Hi, I am developing an application that uses JSF and EJB 3,0 and JPA, and have the necessity to manage when commit or rollback occurs one. In this in case that, I wanted to know if some form exists to create something to listener to alert when one of these two action to me to occur. This necessity appeared therefore the ...

66. CMT: Container Management Transaction

67. Transaction Processing System Design

I do not know it this is the right forum for two of my questions: 1. What general design/architecture would you recommend using to design a transaction processing system with the highest possible throughput? 2. What externally developed components (i.e., database, messaging systems, caching software) should be used for the design? Thank you.

69. What is scope of JTA transaction

What I understand is using JTA transaction type, we can manage transactions which may include multiple resource managers, which may be in different VMs. So I guess this statement means that if current JTA transaction is created in some other VM, then this new resource manager needs to join that active transaction. Is this understanding correct?

70. Transaction Attribute for timeout callback method

Hi all, According to EJB3 specification, @Timeout callback method can have REQUIRED, REQUIRES_NEW or NOT_SUPPORTED transaction attribute. I wonder if there is any case in which Timeout method will be executed with active JTA transaction? According to my understanding about @Timeout callback method, only two REQUIRED & NOT_SUPPORTED transaction attributes are required. It would be great if someone can explain why ...

71. Transaction is alternating Timeouts

Hi all, I am using jboss 5.1.x, EJB3.0 I have MDB which listens to JMS queue. when the MDB taking a message, it dispatch a msg via TCP to some modem. sometimes that Modem doesnt response when the server is waiting for an answer: byte[] byteData = receive(is); coz I cant set timeout on InputStream. so thanks to the EJB container ...

73. javax.transaction.RollbackException

76. Calling methods with TransactionAttributeType.REQUIRED --> transaction rolled back?

Hi! I've got the following problem: (Explanation follows after the example) (Not a quite real example, just wrote it off the top of my head based on the real-world example, but it demonstrates the problem...) class EJB1 { @TransactionAttribute(TransactionAttributeType.REQUIRED) void t1() { throw Exception(); } } class EJB2 { @TransactionAttribute(TransactionAttributeType.REQUIRED) void t2() { } } class Main { @EJB EJB1 e1; ...

77. A question on transactions

83. Using transaction with JSP

public int insert(){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/db?" + "user=myname&password=12345"); String sSQL = "INSERT INTO tbl"; sSQL += "(fielda,fieldb)"; sSQL += " VALUES (?,?)"; prepStat = conn.prepareStatement(sSQL); prepStat.setString(1,"a"); prepStat.setLong(2,"b"); prepStat.executeUpdate(); String sSQL = "INSERT INTO tblB"; sSQL += "(fielda,fieldb)"; sSQL += " VALUES (?,?)"; prepStat = conn.prepareStatement(sSQL); prepStat.setString(1,"c"); prepStat.setLong(2,"d"); prepStat.executeUpdate(); String sSQL ="SELECT MAX(tblid) FROM tblB"; prepStat = conn.prepareStatement(sSQL); rs=prepStat.executeQuery(); ...