Promod kumar

Ranch Hand
+ Follow
since Jun 26, 2006
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Promod kumar

It turns out that once I checked the option "Force http sources to be fetched using http://" on the settings page of the Android SDK and AVD manager, it retrieved all the items which also included the platforms by using the https link. Hopefully this helps someone else.
14 years ago
I am an Android beginner trying to get the environment setup. After downloading the SDK(, I run the SDK manager to download platforms, I only see the following list in the available packages

Google APIs by Google Inc., Android API 6, revision 1
Google APIs by Google Inc., Android API 5, revision 1
Google APIs by Google Inc., Android API 4, revision 2
Google APIs by Google Inc., Android API 3, revision 3
Usb Driver Package, revision 2

I added this site to get the above list, Default https site did not work. My platforms and addons directory is empty. I read the instructions multiple times and I googled quite a bit and did not find the answer. What am I missing. I was expecting to see platforms listed in the above list. I am behind a firewall. I appreciate your response.
14 years ago
Thanks a lot , that was it. I have it bookmarked now.
I am looking for a link where design patterns were discussed in a question and answer format. The questions would list a scenario and we would have to identify the pattern. I found it extermely useful. It was posted by one of the ranchers and I forgot to bookmark it . I searched in vain to locate it. Can anyone post it?

with Required attribute - means its CMT, context.setRollbackOnly - it can be done only with BMT, so illegalStateException raised, bean instance discareded

I think you meant the opposite, EJBContext.setRollbackOnly can be called only by Beans using CMT. If you call it from beans using BMT you will get IllegalStateException.

As for the original question, I suggest

1) Reading section 14.3.4 from core spec
2) Trying all the scenarios out with some code.

When using BMT or CMT, if there is a system exception in the onMessage method, the message will be redelivered. If the bean uses BMT and sets the transaction to rollback, then the message is not redelivered. If the bean uses CMT (Required) and sets the transaction to rollback, then the message is redelivered.
Congrats. I am planning to start on this one shortly.

How does it feel to be on top of the mountain.
14 years ago
I am SCBCD certified, I passed with 85%, a huge relief.

1) I had no prior EJB experience. I used EJB3 in action as the introductory book, very well written book for newbies.
2) I followed the SCBCD forum regularly, it was a very valuable tool in the preparation. There were a lot of questions that I never thought of and there were a lot of helpful people answering them. For a lot of questions, I would code a simple example and see if I could make sense of it.
3) Enthuware definitely helped me with mock tests, I did not do very well on their mocks, 75 was my highest and I failed on one of them. I used it to identify my weak areas and study those a little bit more, I would refer to Specs, MZ notes and other internet resources. I had all kinds of problems with JPQL and EJB roles, I still think they are my weak areas.
4) I rererred to specs selectively for areas like Operations Allowed tables, Exception tables etc.

Let me know if I can help in any way.
14 years ago

Your questions really helped me research topics indepth.
14 years ago
I am using Enthuware and I am satisfied with it, I have not used uCertify.
According to the Operations allowed table on page 88, EntityManager Access is not allowed in PreDestroy methods. Section, page 126 of the core spec shows an example where PreDestroy method calls em.close(). Is this an error?

I am having a tough time with the operations allowed tables (outside of the obvious cases like container manager bean using getUserTransactions()), any pointers on how to go about it. I did read the reasons why operations are not allowed but they don't cover everything. As an example for stateless session bean why is getBusinessObject of sessionContext not allowed in dependency injection methods but allowed in PostConstruct.
I just tried it and got the same result.
I used a RuntimeException as shown below.

Sections 4.4.3 talks about scenarios when PreDestroy calls are missed. I tried it on Jboss 4.2.2 and @PreDestroy method was called when the instance threw a System Exception.

• A crash of the EJB container.
• A system exception thrown from the instance’s method to the container.
• A timeout of client inactivity while the instance is in the passive state. The timeout is specified
by the Deployer in an EJB container implementation-specific way.

Section 5.4.18 has the scenarios for MDBs. I tested it, saw that @PreDestroy was executed in this case as well. Is the container I am not using not compliant or am I missing something?

If Jboss 4.2.2 is non compliant, then would it be safe to summarize that when there is a SystemException for Session Bean or MDB, @PreDestroy method (if it exists) will not be called?

But if you used REQUIRED attribute here, and if the transaction is rolledback, the timer will be implicitly canceled with transaction rollback. So, if you used this timer to complete some periodic tasks, further invocations on that will not be done.

The @Timeout method is the method which gets triggered periodically, the actually timer creation is usually done in a different business method. So if the transaction rolls back in the @Timeout method, the timer should not be cancelled. Here is some supporting documentation from the spec. An interesting sidenote is that in both the cases of Required and Requires_New, a new transaction is created for the execution of the @Timeout method.

18.2.5 Transactions
An enterprise bean typically creates a timer within the scope of a transaction. If the transaction is then
rolled back, the timer creation is rolled back.

An enterprise bean typically cancels a timer within a transaction. If the transaction is rolled back, the
container rescinds the timer cancellation.

The timeout callback method is typically has transaction attribute REQUIRED or REQUIRES_NEW
(Required or RequiresNew if the deployment descriptor is used to specify the transaction
attribute). If the transaction is rolled back, the container retries the timeout.

Note that the container must start a new transaction if the REQUIRED (Required) transaction
attribute is used. This transaction attribute value is allowed so that specification of a
transaction attribute for the timeout callback method can be defaulted.