System Programming and Hibernate ORM
Advanced programming quiz covering Unix/Linux system programming (IPC, threads, sockets, file operations) and Java Hibernate ORM framework concepts
Questions
6.) How do I get my program to act like a daemon?
- a) Run with root user
- b) Run with &
- c) Run with root user using &
- d) None
Does hibernate require persistent classes to implement Serializable?
- Required
- b) Not Required
- c) None of the above
- All of the above
What does CacheMode do ?
- a) a) controls how a particular SessionFactory interacts with the Data Base.
- b) controls how a particular SessionFactory interacts with the second-level cache.
- c) controls how a particular session interacts with the second-level cache.
- d) None
7.) Why do processes never decrease in size?
- a) They never releases the memory utilized
- b) They release the memory but kernel does not use them
- c) Since they are running
- d) It’s a false statement
If instances are not in the session or second-level cache which will give better performance?
- a) Query.list()
- b) Query.iterate()
- c) Both are same
- d) None of the above
8.) What is the difference between select() & poll()?
- a) select() and poll() have no differences
- b) poll() is event driven while select() is not
- c) select() is event driven while poll() is not
- d) None
What does sess.delete() do?
- a) remove data from in memory
- b) remove from database.
- c) remove from sessionFactory
- d) None of the above.
9.) How do I `lock' a file?
- a) Use filelock()
- b) use lockfile()
- c) Use lockfd()
- d) use fcntl()
How can a whole class be mapped as immutable?
- a) By using the mutable="false" attribute in the class mapping.
- b) By using the ismutable="false" attribute in the class mapping.
- c) By using the ismutable="no" attribute in the class mapping.
- d) None
10.) What is a NFS?
- a) National File System
- b) Network Flashmemory System
- c) Network File System
- d) Network Fault System
what does hibernate.hbm2ddl.auto create this means ?
- create tables automatically
- b) create session object automatically
- c) create Session Factory object automatically
- d) None
11.) How can I tell how much memory my system has?
- a) Use getmemory()
- b) Use sysctl()
- c) Use freemem()
- d) Use malloc()
Employee emp = session.load(Employee .class);
- Yes
- b) No
- Cant say
- Both
28 ____ forces hibernate to bypass the setter method and access the instance variable directly while initializing a newly loaded object.
- a) By mapping the property with access="onlyfield" in Hibernate metadata
- b) By mapping the property with access="variable" in Hibernate metadata
- c) By mapping the property with access="field" in Hibernate metadata
- d) none of the above
11.) How can I tell how much memory my system has?
- a) Use getmemory()
- b) Use sysctl()
- c) Use freemem()
- d) Use malloc()
Difference between Emp e = session.load(Emp.class) and Emp e = session.createCriteria(Emp.class) ?
- a) On session close session.load() Emp Object unavailable to access
- b) On session close session.createCriteria() Emp unavailable to access
- c) None
- Both a & b
12.) What is a socket
- a) A port to connect printer
- b) A port to connect keyboard
- c) An abstraction to pass data across processes
- d) A hardware device
13.) What is a message queue?
- a) A printer queue
- b) An IPC mechanism with destructive execute
- c) An IPC mechanism with destructive write
- d) An IPC mechanism with destructive read
14.) What is a pthred
- a) A printer thread
- b) A POSIX standard thread to support multi-tasking
- c) A POSIX standard thread to support multi-threading
- d) A POSIX standard thread to support kernel debugging
15.) If open() is used to open a non-existent file in read-only mode what will happen
- a) Creates File
- b) Does nothing
- c) Return error
- d) Not allowed.