Exam Information
Free practice questions with explanations
Oracle 1Z0-900 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 11
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Implement Business Logic by Using EJBs
A retail company runs an order-processing module as a stateless session bean on a Java EE 7 server. A method reserveStock() calls two other EJB methods, each of which writes to a separate inventory database through a JTA data source. The team wants the entire reservation to roll back if either write fails, and the company's standard is that the container, not the developers, manages transaction boundaries. One developer proposes annotating the bean class with @TransactionManagement(TransactionManagementType.BEAN) and calling UserTransaction.begin() manually so that each inner call can start its own transaction. Another developer wants the methods to use @TransactionAttribute(REQUIRES_NEW) so that each call is isolated. The bean must not be changed to use JDBC-level transactions. Which approach meets the requirements?
Correct Answer: CExplanationWith container-managed transactions, REQUIRED makes reserveStock() start a transaction if none exists, and the inner calls, which default to REQUIRED, join it. A failure in either write marks the shared transaction for rollback, satisfying the all-or-nothing rule while keeping the container in control. REQUIRES_NEW suspends the caller's transaction and commits each call separately, so a later failure cannot undo an earlier write. NOT_SUPPORTED runs without a global transaction at all, breaking atomicity. Switching to bean-managed transactions violates the stated standard and, with per-method UserTransaction calls, produces independent transactions anyway.
-
2 Question 2 Single choice Create Java Web Applications using Servlets
A government portal exposes a servlet at /applications/* that accepts file uploads. Compliance requires that every request to the servlet be logged, including requests that are rejected by an earlier check, and that a request lacking a valid session cookie be refused before any upload processing happens. The team has a servlet filter mapped to /* that writes the audit log and a second filter mapped to /applications/* that validates the session. Operations has complained that uploads from unauthenticated clients sometimes reach the servlet after the audit entry is written, and that the audit entry is missing for some redirected requests. The filters are ordered in web.xml with the session check declared first. Which change most directly fixes both problems?
Correct Answer: DExplanationFilters run in the order their mappings are declared in web.xml, and the session check was declared first, so unauthenticated requests reached the chain's end point after the check only in the sense of being processed before the audit filter was reached in the chain. Declaring the audit filter first makes it wrap the entire chain and log every request, including those the session filter rejects by calling sendRedirect and returning. Changing the session filter to a servlet-name mapping does not alter ordering relative to the audit filter. Replacing filters with a listener removes the ability to intercept individual requests as the spec intends. Adding an ERROR dispatcher affects error-page forwards, not the ordering problem.
-
3 Question 3 Order list Manage Persistence using JPA Entities and BeanValidation
A hospital application persists Patient entities through a JPA EntityManager inside a container-managed transaction. Patient records have a @NotNull name and a @Pattern constraint on the national identifier, and the business rule requires that invalid data is rejected before any SQL is sent to the database. The team also wants the identifier to be generated by the database sequence on first persist. Arrange the steps in the order they must be performed when a new Patient is saved.
Drag the steps into the correct order, or use the arrows.
- If any constraint is violated, a ConstraintViolationException is raised and the transaction is marked for rollback.
- The provider assigns the identifier from the configured sequence generator during the persist operation.
- The provider issues the INSERT statement to the database when the flush occurs at commit.
- The container calls the Bean Validation engine on the Patient instance when the entity is persisted and the transaction is flushed.
- The client invokes persist() on the EntityManager with a new Patient instance that has no identifier.
Correct Answer:- The container calls the Bean Validation engine on the Patient instance when the entity is persisted and the transaction is flushed.
- The client invokes persist() on the EntityManager with a new Patient instance that has no identifier.
- The provider assigns the identifier from the configured sequence generator during the persist operation.
- If any constraint is violated, a ConstraintViolationException is raised and the transaction is marked for rollback.
- The provider issues the INSERT statement to the database when the flush occurs at commit.
ExplanationThe client calls persist() with a transient entity. The provider assigns the generated key from the sequence during persist, which is when the identifier becomes known. Bean Validation runs as a pre-persist and pre-update step before the flush writes SQL, so an invalid entity throws ConstraintViolationException and the transaction rolls back. The INSERT is issued at flush, which happens at commit or when the provider decides. The ordering places validation before the INSERT as the business rule requires.
-
4 Question 4 Drag and drop Use Java Message Service API
A logistics company uses JMS within a Java EE 7 application server. Orders arrive on a queue and must be processed exactly once in a transaction that also updates a database. Shipment status notifications must reach every subscribed dashboard, including dashboards that are offline at the time of publication and will reconnect later, and those durable subscribers must receive the messages. The team also needs a component that consumes queue messages asynchronously without writing a polling loop. Match each requirement to the JMS feature that satisfies it.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
Consume queue messages asynchronously without a polling loopProcess each order message exactly once, rolled back together with the database updateDeliver shipment notifications to offline dashboards when they reconnectDurable topic subscription identified by a client ID and subscription nameBrowser-based polling of a request-scoped servletContainer-managed transaction with a message-driven bean consuming from the queueMessage listener implemented by a message-driven beanNon-persistent delivery mode on a temporary queueCorrect Answer:- Process each order message exactly once, rolled back together with the database update → Container-managed transaction with a message-driven bean consuming from the queue
- Deliver shipment notifications to offline dashboards when they reconnect → Durable topic subscription identified by a client ID and subscription name
- Consume queue messages asynchronously without a polling loop → Message listener implemented by a message-driven bean
ExplanationA message-driven bean with a container-managed transaction receives each queue message as part of the transaction, so a rollback returns the message to the queue and the database changes are undone together. Durable topic subscriptions retain messages for an inactive subscriber identified by client ID and subscription name, which is what the offline dashboards need. Message listeners in MDBs provide asynchronous delivery without polling. Non-persistent delivery would lose messages across restarts and offline periods, and temporary queues do not survive the connection. Browser polling contradicts the no-polling requirement.
-
5 Question 5 Single choice Implement REST Services using JAX-RS API
A telecom provider exposes a JAX-RS resource for managing SIM activations. The endpoint POST /activations creates an activation, and clients retry on network timeouts. Architects require that a retried POST with the same client-supplied request identifier must not create a duplicate activation, and the response for a successful creation must give the client the URI of the new resource. The service runs on a Java EE 7 server, and the team wants to use the standard JAX-RS API without adding custom retry frameworks. Which implementation best meets these requirements?
Correct Answer: AExplanationA successful creation via POST should return 201 Created with a Location header pointing to the new resource, which is what the JAX-RS Response.created method produces. Checking the client-supplied request identifier before inserting makes the operation idempotent for retries, the behaviour the architects need. A PUT to a fixed URI would only be idempotent if the client chose the URI, which the stem does not state. Returning 202 with no Location hides the resource and defers creation unnecessarily. A 204 response with no body gives the client no URI and pushes the retry problem onto the client.
-
6 Question 6 Multiple choice Secure Java EE 7 Applications
A banking intranet deployed on a Java EE 7 server must restrict the page /admin/* to members of the role Auditor, and all access to the application must be encrypted in transit. Tellers must not be able to reach the admin pages even by typing the URL, and the team prefers declarative security over programmatic checks inside the servlets. Which TWO configuration elements together meet these requirements? (Choose two.)
Correct Answer: A, EExplanationDeclarative security in web.xml uses a security-constraint with a web-resource-collection to select the URL pattern and an auth-constraint to name the roles allowed, which blocks tellers from the admin URLs. Transport confidentiality is declared with a user-data-constraint whose transport-guarantee of CONFIDENTIAL forces the container to require HTTPS. The isUserInRole call and the custom filter are programmatic, which the team wants to avoid. A login-config only chooses the authentication mechanism and does not restrict resources or encrypt traffic on its own.
-
7 Question 7 Single choice Use Concurrency API in Java EE 7 Applications
A payments service must run a nightly reconciliation task that calls several downstream web services in parallel and then merges the results. The application runs on a Java EE 7 server, and the operations team forbids creating raw threads because the container must manage thread context, security, and transactions for the task. The developer proposes injecting a ManagedExecutorService with @Resource and submitting one Callable per downstream call, then collecting Future results. A reviewer says the merge step should not block a container thread waiting on each future in sequence. Which change best addresses the reviewer's concern while keeping container-managed threads?
Correct Answer: DExplanationJava EE 7 managed executors can supply a CompletableFuture and its dependent stages through the managed executor, so the merge runs on a container-managed thread once the parallel results are ready and nothing blocks while waiting. A plain ExecutorService bypasses container context propagation, which the operations team forbids. A ManagedScheduledExecutorService with zero delay still requires blocking gets for merging and does not fix the waiting problem. Starting raw threads inside each Callable violates the explicit ban on raw threads.
-
8 Question 8 Single choice Create Java Applications using WebSockets
A stock quote service uses a JSR 356 server endpoint at /quotes. Clients send subscription messages containing a JSON ticker symbol, and the server pushes a QuoteUpdate object back on the same session. The team wants the server to receive text frames, convert them to a Subscription object, and send QuoteUpdate objects as binary-free JSON without writing parsing code in the endpoint method. The solution must use the standard JSR 356 API for encoding and decoding. Which design satisfies these requirements?
Correct Answer: CExplanationJSR 356 supports declarative conversion of WebSocket messages through Decoder.Text and Encoder.Text implementations, registered in the decoders and encoders attributes of @ServerEndpoint, so endpoint methods can receive and return domain objects directly. Binary serialization with ObjectOutputStream contradicts the text JSON requirement and the stated approach to encoding. Manual parsing inside the endpoint violates the no-parsing-code requirement. Binary encoders would send binary frames, not the JSON text the team asked for.
-
9 Question 9 Dropdown Use CDI Beans
A reporting module uses CDI in a Java EE 7 application. A producer method must supply a single shared DataSourceConfig bean for injection into several services, and a second producer must supply a PaymentGateway that is chosen at deployment based on a qualifier, not by injection-point type alone. Administrators must be able to add a new gateway implementation without editing the injecting services. Complete the producer declarations by selecting the correct values for each blank.
Choose the correct value for each blank.
@Produces @ApplicationScoped @ DataSourceConfig config() { ... }
@Produces @ @Sandbox PaymentGateway gateway() { ... }Correct Answer:@Produces @ApplicationScoped @Singleton DataSourceConfig config() { ... }
@Produces @Dependent @Sandbox PaymentGateway gateway() { ... }ExplanationA singleton-like bean for configuration is expressed with @Singleton only in EJB terms, but for CDI, a producer that should yield one instance per application scope uses the scope annotation, so the first blank is the Singleton stereotype-free choice and the second blank is Dependent, which means the producer result follows the injection point's lifetime. The @Sandbox qualifier selects the gateway by qualifier, so injecting services stay unchanged when a new implementation with the same qualifier is added. Named would add an EL name rather than sharing config, Default would not select by qualifier, Alternative requires explicit enabling, Stateless is EJB-only, Typed and Vetoed do not control producer lifetime or selection.
-
10 Question 10 Single choice Use Batch API in Java EE 7 Applications
A utility company runs a nightly batch job that reads meter readings from a flat file, validates them, and writes valid rows to a database. The job must be restartable after a failure without reprocessing rows already committed, and a single bad record must be skipped rather than failing the whole job. The team uses a JSR 352 job defined in XML. Which configuration in the job specification best meets these requirements?
Correct Answer: CExplanationA JSR 352 chunk step with a reader that implements checkpointing keeps committed progress in the job repository, so a restart resumes after the last checkpoint rather than from the beginning. The skip element with a skippable-exception-class lets the step skip bad records and continue, as the requirement says. A single-transaction batchlet loses committed-progress tracking and cannot skip records. Retry limits do not skip bad items and omitting checkpoints breaks the restart requirement. A decision branch that reruns the whole file reprocesses committed rows.
-
11 Question 11 Single choice Use Java Message Service API
An order management system sends JMS messages from a servlet that runs inside a container-managed transaction on a Java EE 7 server. Downstream systems must never see an order confirmation for an order that was rolled back in the database. The developer uses an injected JMSContext in the servlet and calls send() before the database commit. Which change ensures the message is delivered only if the database transaction commits?
Correct Answer: CExplanationAn injected JMSContext used within a container-managed JTA transaction enlists its send in that transaction, so the message is held until the transaction commits and discarded on rollback. Sending after the database commit cannot be relied on for consistency, and acknowledgement mode does not alter transactional enlistment. Delivery mode controls persistence, not commit coupling, so NON_PERSISTENT would not prevent delivery on rollback. Calling commit on a transacted session inside a container-managed transaction creates a separate transaction that is not coordinated with the database.
These are 11 of the 142 questions in the full 1Z0-900 pack.
Get All 142 QuestionsGet all 142 questions & answers
Full access options for Oracle 1Z0-900
Self-study
PDF Version
- 142 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 142 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 142 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the 1Z0-900 Exam (Java EE 7 Application Developer) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.