Bloomberg LP Interview Question






Comment hidden because of low score. Click to expand.
2
of 2 vote

cn.flush()

- Neeraj Asrani July 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

According to the question, I guess we need the function that updates the underlying persistence layer with the results of the query. Hence cn.flush() is the answer I guess.

Reference: w w w . velocityreviews.com/forums/t509980-difference-between-commit-and-flush-in-hibernate.html

- Anonymous February 25, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

cn.commit() is the one that makes the changes permanent and visible to others.

- Krovi. July 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Its Auto Commit already.

- ksaswat October 06, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

cn.setAutoCommit(false);

- Rishi October 15, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

flush() is not even a method of interface Connection
commit() - Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.

- mk April 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

flush() is not even a method of interface Connection
commit() - Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.

- mk April 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

cn.aetAutoCommit(false) allows to group multiple subsequent statements under the same transaction. The transaction will be committed when cn.commit(); is invoked. Changing the auto-commit mode through connection.setAutoCommit() will implicitly commit the active transaction and create a new one.

However, only calling connection.setAutoCommit(false); doesn't creates a transaction. It only means that any statement created using this connection will be committed together when you call connection.commit();.

- ruppu May 28, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More