APEX equivalent of Java Static Initialization Block

Is there a APEX equivalent of Java static init block (i.e. execute once at class load time)? My use case is that I need to load some configuration values to an environment (i.e. APEX Workspace) specific variables and don't want to do per user session since the values remain the same for all user sessions. I believe SYS_CONTEXT is tied to user session and would not be useful for my usecase. Any advise would be appreciated.

Hello,
You should check the concept of User Preferences and see if it can help you:
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21678/aadm_mg_sessions.htm#BABHFEFD
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More

Similar Messages

  • Initializing array elements on a static initialization block

    Hello,
    I have this class:
    class Foo{
        public static Wing[] flights = new Wing[20]; //initialize with null Wing references
        static { //static initialization block - begin
            for(Wing w : flights){ //for each Wing slot on the array,
                w = new Wing();      //create a Wing object and refer to it
            } // static init block - endThe code above creates a Wing array, and the static init block should create 20 Wing objects on the array slots, but the objects are lost when I try to use it in the main method on the same class Foo:
        public static void main(String[] args){
             System.out.println(flights[3].name); //will throw NullPointerException -> Array elements have not been initialized  
        }How is that possible? The init code for(Wing w : flights) looks like has created copies of the objects, and not just references to the same object. If I change the static init block to the "old-fashioned for loop"
    for (int i=0; i < flights.length; i++){
    flights[i] = new Wing();then it works.
    But I think that the problem is not on the kind of for loop itself, because if I use same static initialization statement, with for (Wing w : flights) on the main method, instead of in a separate init block, the array gets populated with solid objects.
    Any ideas of what I am doing wrong?
    Java version: 5.0

    I think I got it. I am reseting the reference to point to a new Object in the heap instead of the array slot. :-P

  • Instance initializer and static initializer blocks

    Hi guys,
    I read about the above mentioned in the JLS and also in a book before, but I still don't quite understand, what is the use of these. I sort of have a rough idea, but not exactly. I mean, what is the purpose of the instance initializer and static initializer blocks, how can it be useful? I understand I can execute pieces of code that will initialize instance and static variables accordingly, but how is it different then to using a constructor to initialize these fields? Are these pieces of code executed before any constructor is executed, or when otherwise?
    Sorry for my noob, I'm learning.
    PR.

    Static initializers are useful for initializing a class when the initialization is more complex than simply setting a single variable, or when that initialization can throw a checked exception.
    public class Foo {
      private static final Bar bar;
      static {
        try {
          bar = new Bar();
          bar.doSomeInitializationStuff();
        catch (SomeCheckedExceptionThatBarThrows e) {
          throw new ExceptionInInitializerError(e);
    }Here we could not do the two-step new Bar() + doSomeInit() stuff in the line where we declare the bar variable. Additionally, assuming that one or both of those can throw a checked exception, we could not do that on the declaration line; we need the static initializer to wrap that in the appropriate unchecked exception.
    This allows us to do more complex class initialization when the class is loaded than we could do with a simple variable initialization.
    Instance initializers are useful if you want to perform the same steps in every constructor and don't want to have to repeat the code in each constructor. Instance initializers are executed as the first step of each constructor (or maybe it's after any super() calls, I forget).

  • Static initializer block

    use of static initializer block

    Going directly to the point aren't you?
    A ststic initializer block is used, well, to initializes static variable! It is called when the class is loaded.
    It is use like this.
    public MyClass {
       static {
          private int foo = 38;
       public static int getFoo() {
          return foo;
    }

  • Uncaught exception: Static initializer: java/lang/SecurityException

    So i'm trying to compile some code of a small game for Doja.
    The code compiles fine but when i load it in the emulator i get the following eror:
    Uncaught exception java/lang/Error: Static initializer: java/lang/SecurityException.
    Now i haven't seen that before. I looked into it and first i thought there must be some static initializer block in some class but there isn't.
    Now i'm kinda stumped. What else can be the problem?

    A security exception is usually thrown when you try to use some function of the API that you're not allowed to use.
    For example, if the user has not given your application permission to connect to the internet, but you try to do so.
    Sometimes this error can be resolved by turning on the appropriate option in the ADF file.
    Cheers,
    Sam

  • JSP behavior - static initializer and jspInit

    In a recent discussion, the concept of using a static intializer in a JSP came up. The situtation was that someone had a series of Strings used in a single JSP and they wanted to #1, define these strings in the JSP itself (vs in web.xml or a resource file, which while preferable, was not really an item of discussion) and #2 wanted indexed access to the Strings (such as via a Map).
    My thought was to declare the Map variable as static final in the JSP and then initialize it in a static initializer block with Map.put operations. Both the declaration of the Map and the static initializer block would be declared in a <%! %> declaration tag block. (The thought behind the static initialization - vs overriding jspInit - being that if multiple instances of the JSP were to be created, we wouldn't want to keep put'ing values into the Map for each new instance of the JSP.)
    I built the following test scenario:
    <<untitled3.jsp source>>
    <%@ page import="java.util.*" %>
    <%!
    static final Map m = new HashMap();
    static int staticCount = 0;
    static int jspInitCount = 0;
    static {
    System.out.println("static initializer called");
    staticCount++;
    m.put("staticCount"+staticCount, "static# " + staticCount);
         public void jspInit() {
              super.jspInit();
    jspInitCount++;
    m.put("jspInitCount"+jspInitCount, "jspInit# " + jspInitCount);
    System.out.println("overriden jspInit called:" + this);
    %>
    Map values:<br>
    <%
    Collection values = m.values();
    Iterator i = values.iterator();
    while (i.hasNext()) {
    out.println(i.next().toString() + "<br>");
    %>
    Test
    <<end of untitled3.jsp source>>
    with the following web.xml entries:
    <servlet>
    <servlet-name>JSPServlet1</servlet-name>
    <jsp-file>untitled3.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>JSPServlet2</servlet-name>
    <jsp-file>untitled3.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>JSPServlet1</servlet-name>
    <url-pattern>/jsp1</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>JSPServlet1</servlet-name>
    <url-pattern>/jsp2</url-pattern>
    </servlet-mapping>
    I open a browser and request untitled3.jsp, I get the following output in the browser:
    Map values:
    static# 1
    jspInit# 1
    Test
    with the following output to my JDeveloper (9.0.3.1) log window:
    static initializer called
    overriden jspInit called:_untitled3@61
    I then request /jsp1 and get the following output in the browser:
    Map values:
    static# 1
    jspInit# 2
    jspInit# 1
    Test
    with the following output to my log window:
    overriden jspInit called:_untitled3@63
    Subsequent calls to /jsp1, /jsp2 or untitled3.jsp result in that same last output in the browser and no further output in the log window (ie, no further calls to the static initializer or jspInit method)
    So, it appears that jspInit is being called once for the unmapped JSP request and one more time, the first time one of the web.xml-mapped JSP instances is requested. (I'd have thought that it would be called once for the /jsp1 request and once for the /jsp2 request...), but the static initializer is being called only once as expected.
    Is this the correct behavior for the jspInit method? (ie, being called once for the unmapped request and once for the first mapped request?)
    Also, if OC4J is used in a clustered/balanced configuration, is it possible that I'd end up with additional instances of my JSP in one or more JVMs?
    Thanks!
    Jim Stoll

    You could scope such info to the application scope - some info is provided here: http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html
    "application - You can use the Bean from any JSP page in the same application as the JSP page that created the Bean. The Bean exists across an entire JSP application, and any page in the application can use the Bean."

  • Initialization block vs constructor

    Dear,
    Inside a class in Java, it is possible to declare a block (between '{ }') and declaring it 'static'. This is a 'initialization block' executed once when the class is loaded = before an object of this class is created.
    But this seems to me very close to the functionality of a class constructor function, except this is runned each time the class is instanciated.
    Can somebody give me good examples illustrating when each of them are needed (separately or together) ?
    Is class loading not occuring at the instanciation time of a class (as constructor execution) ?
    Thanks in advance.

    dcminter wrote:
    The USER_ROLES field can be accessed before the containing class has been instantiated (note that class loading and class instantiation are quite different things). If you put that logic into the constructor, you would get an empty set in those circumstances.Iinstead of using the static initializer block in the containing class
    you can put the initialization into the Set using literals
        public static final Set<String> USER_ROLES = Collections.unmodifiableSet(
            new HashSet<String>(Arrays.asList(new String[]{"USER","OWNER","ADMINISTRATOR"}))
        );or using the instance initializer block of the Set
        public static final Set<String> USER_ROLES = Collections.unmodifiableSet(
            new HashSet<String>(){{
                add("USER");
                add("OWNER");
                add("ADMINISTRATOR");
        );

  • Initialization Blocks -- Practical Example.

    I am curious about I topic that I have just recently learned about and would like to post it for discussion.
    Does anyone know of a practical example of the use of an initialization block? Why would one want to use an initialization block? What can be accomplished with an initialization block that you cannot accomplish with a constructor that doesn't accept any parameters?

    Hi Robert,
    Initializers are used in initialization of object and classes. They can also be used to define constants in Interfaces.
    Here I am explaning by corelating the Constructor with Initialization.
    In what order is initialization code executed? What should I put where ?
    Instance variable initialization code can go in three places within a class:
    In an instance variable initializer for a class (or a superclass).
    class C {
    String var = "val";
    In a constructor for a class (or a superclass).
    public C() { var = "val"; }
    In an object initializer block. This is new in Java 1.1; its just like a static initializer block but without the keyword static.
    { var = "val"; }
    The order of evaluation (ignoring out of memory problems) when you say new C() is:
    1.Call a constructor for C's superclass (unless C is Object, in which case it has no superclass). It will always be the no-argument constructor, unless the programmer explicitly coded super(...) as
    the very first statement of the constructor.
    2.Once the super constructor has returned, execute any instance variable initializers and object initializer blocks in textual (left-to-right) order. Don't be confused by the fact that javadoc and
    javap use alphabetical ordering; that's not important here.
    3.Now execute the remainder of the body for the constructor. This can set instance variables or do anything else.
    In general, you have a lot of freedom to choose any of these three forms. My recommendation is to use instance variable initailizers in cases where there is a variable that takes the same value
    regardless of which constructor is used. Use object initializer blocks only when initialization is complex (e.g. it requires a loop) and you don't want to repeat it in multiple constructors. Use a constructor
    for the rest.
    Here's another example:
    Program:
    class A {
    String a1 = ABC.echo(" 1: a1");
    String a2 = ABC.echo(" 2: a2");
    public A() {ABC.echo(" 3: A()");}
    class B extends A {
    String b1 = ABC.echo(" 4: b1");
    String b2;
    public B() {
    ABC.echo(" 5: B()");
    b1 = ABC.echo(" 6: b1 reset");
    a2 = ABC.echo(" 7: a2 reset");
    class C extends B {
    String c1;
    { c1 = ABC.echo(" 8: c1"); }
    String c2;
    String c3 = ABC.echo(" 9: c3");
    public C() {
    ABC.echo("10: C()");
    c2 = ABC.echo("11: c2");
    b2 = ABC.echo("12: b2");
    public class ABC {
    static String echo(String arg) {
    System.out.println(arg);
    return arg;
    public static void main(String[] args) {
    new C();
    Output:
    1: a1
    2: a2
    3: A()
    4: b1
    5: B()
    6: b1 reset
    7: a2 reset
    8: c1
    9: c3
    10: C()
    11: c2
    12: b2
    When should I use constructors, and when should I use other methods?
    The glib answer is to use constructors when you want a new object; that's what the keyword new is for. The infrequent answer is that constructors are often over-used, both in when they are called and
    in how much they have to do. Here are some points to consider
    Modifiers: As we saw in the previous question, one can go overboard in providing too many constructors. It is usually better to minimize the number of constructors, and then provide modifier
    methods, that do the rest of the initialization. If the modifiers return this, then you can create a useful object in one expression; if not, you will need to use a series of statements. Modifiers are
    good because often the changes you want to make during construction are also changes you will want to make later, so why duplicate code between constructors and methods.
    Factories: Often you want to create something that is an instance of some class or interface, but you either don't care exactly which subclass to create, or you want to defer that decision to
    runtime. For example, if you are writing a calculator applet, you might wish that you could call new Number(string), and have this return a Double if string is in floating point format, or a Long if
    string is in integer format. But you can't do that for two reasons: Number is an abstract class, so you can't invoke its constructor directly, and any call to a constructor must return a new instance
    of that class directly, not of a subclass. A method which returns objects like a constructor but that has more freedom in how the object is made (and what type it is) is called a factory. Java has no
    built-in support or conventions for factories, but you will want to invent conventions for using them in your code.
    Caching and Recycling: A constructor must create a new object. But creating a new object is a fairly expensive operation. Just as in the real world, you can avoid costly garbage collection by
    recycling. For example, new Boolean(x) creates a new Boolean, but you should almost always use instead (x ? Boolean.TRUE : Boolean.FALSE), which recycles an existing value rather than
    wastefully creating a new one. Java would have been better off if it advertised a method that did just this, rather than advertising the constructor. Boolean is just one example; you should also
    consider recycling of other immutable classes, including Character, Integer, and perhaps many of your own classes. Below is an example of a recycling factory for Numbers. If I had my choice, I
    would call this Number.make, but of course I can't add methods to the Number class, so it will have to go somewhere else.
    public Number numberFactory(String str) throws NumberFormatException {
    try {
    long l = Long.parseLong(str);
    if (l >= 0 && l < cachedLongs.length) {
    int i = (int)l;
    if (cachedLongs[i] != null) return cachedLongs;
    else return cachedLongs[i] = new Long(str);
    } else {
    return new Long(l);
    } catch (NumberFormatException e) {
    double d = Double.parseDouble(str);
    return d == 0.0 ? ZERO : d == 1.0 ? ONE : new Double(d);
    private Long[] cachedLongs = new Long[100];
    private Double ZERO = new Double(0.0);
    private Double ONE = new Double(1.0);
    We see that new is a useful convention, but that factories and recycling are also useful. Java chose to support only new because it is the simplest possibility, and the Java philosophy is to keep the
    language itself as simple as possible. But that doesn't mean your class libraries need to stick to the lowest denominator. (And it shouldn't have meant that the built-in libraries stuck to it, but alas, they
    did.)
    I have a class with six instance variables, each of which could be initialized or not. Should I write 64 constructors?
    Of course you don't need (26) constructors. Let's say you have a class C defined as follows:
    public class C { int a,b,c,d,e,f; }
    Here are some things you can do for constructors:
    1.Guess at what combinations of variables will likely be wanted, and provide constructors for those combinations. Pro: That's how it's usually done. Con: Difficult to guess correctly; lots of
    redundant code to write.
    2.Define setters that can be cascaded because they return this. That is, define a setter for each instance variable, then use them after a call to the default constructor:
    public C setA(int val) { a = val; return this; }
    new C().setA(1).setC(3).setE(5);
    Pro: This is a reasonably simple and efficient approach. A similar idea is discussed by Bjarne Stroustrop on page 156 of The Design and Evolution of C++. Con: You need to write all the little
    setters, they aren't JavaBean-compliant (since they return this, not void), they don't work if there are interactions between two values.
    3.Use the default constructor for an anonymous sub-class with a non-static initializer:
    new C() {{ a = 1; c = 3; e = 5; }}
    Pro: Very concise; no mess with setters. Con: The instance variables can't be private, you have the overhead of a sub-class, your object won't actually have C as its class (although it will still be an
    instanceof C), it only works if you have accessible instance variables, and many people, including experienced Java programmers, won't understand it. Actually, its quite simple: You are defining a
    new, unnamed (anonymous) subclass of C, with no new methods or variables, but with an initialization block that initializes a, c, and e. Along with defining this class, you are also making an
    instance. When I showed this to Guy Steele, he said "heh, heh! That's pretty cute, all right, but I'm not sure I would advocate widespread use..."
    4.You can switch to a language that directly supports this idiom.. For example, C++ has optional arguments. So you can do this:
    class C {
    public: C(int a=1, int b=2, int c=3, int d=4, int e=5);
    new C(10);
    Common Lisp has keyword arguments as well as optional arguments, so you can do this:
    (defstruct C a b c d e f) ; Defines the class
    (make-C :a 1 :c 3 :e 5) ; Construct an
    instance
    What about class initialization?
    It is important to distinguish class initialization from instance creation. An instance is created when you call a constructor with new. A class C is initialized the first time it is actively used. At that time,
    the initialization code for the class is run, in textual order. There are two kinds of class initialization code: static initializer blocks (static { ... }), and class variable initializers (static String var =
    Active use is defined as the first time you do any one of the following:
    1.Create an instance of C by calling a constructor;
    2.Call a static method that is defined in C (not inherited);
    3.Assign or access a static variable that is declared (not inherited) in C. It does not count if the static variable is initialized with a constant expression (one involving only primitive operators (like +
    or ||), literals, and static final variables), because these are initialized at compile time.
    Here is an example:
    Program:
    class A {
    static String a1 = ABC.echo(" 1: a1");
    static String a2 = ABC.echo(" 2: a2");
    class B extends A {
    static String b1 = ABC.echo(" 3: b1");
    static String b2;
    static {
    ABC.echo(" 4: B()");
    b1 = ABC.echo(" 5: b1 reset");
    a2 = ABC.echo(" 6: a2 reset");
    class C extends B {
    static String c1;
    static { c1 = ABC.echo(" 7: c1"); }
    static String c2;
    static String c3 = ABC.echo(" 8: c3");
    static {
    ABC.echo(" 9: C()");
    c2 = ABC.echo("10: c2");
    b2 = ABC.echo("11: b2");
    public class ABC {
    static String echo(String arg) {
    System.out.println(arg);
    return arg;
    public static void main(String[] args) {
    new C();
    Output:
    1: a1
    2: a2
    3: b1
    4: B()
    5: b1 reset
    6: a2 reset
    7: c1
    8: c3
    9: C()
    10: c2
    11: b2
    I hope the above will help you.
    Thanks
    Bakrudeen

  • Exception in static initializer

    Hi,
    I have one class with one static variable.
    I am initializing this variable in static initializer block. But while initializing, it is throwing some checked exception which I dont want to catch in block.
    Static initializer block doesn't support "throws", what should be done?
    Thanks

    hm..
    I think it depends on implementation.. etc
    Anyways, point is not where I should catch the
    exception. Point is, how can I throw the exception to
    caller when I am initializing static members. I don't think this makes sense! The 'caller' has to be the class loader so unless you are using your own class loader then you don't have any real choice.
    You could always wrap the exception in an un-checked exception and let the system handle it but this may just close the application anyway!

  • Help required on java.lang.StackOverFlowError and static initializer

    I wanted to create an instance of a class that contains another instance of the same class. So I wrote:
    class A {
         A z = new A ();     
         void display () {
              System.out.println ("Hello World");
         public static void main (String [] args) {
              A y = new A();
              y.display ();
    }During execution I got java.lang.StackOverFlowError. But if I put a static initializer, it works fine. Here is the code using static initializer.
    class A {
         static{
              A z = new A ();     
         void display () {
              System.out.println ("Hello World");
         public static void main (String [] args) {
              A y = new A();
              y.display ();
    }Could anyone please help me to understand the logic why "java.lang.StackOverFlowError" is happening here and how the same program runs fine by putting a static initializer ?
    Regards,
    Shambhu

    Could anyone please help me to understand the logic
    why "java.lang.StackOverFlowError" is happening hereWhen you instantiate an A object with A y = new A () then A z = new A () also gets executed inside the A class, which in it's turn executes A z = new A () again, and again, and again...
    and how the same program runs fine by putting a
    static initializer ?Because the static block gets executed only once.
    The use of class- and instance variables is explained in more detail here:
    http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html

  • Static initialization of java code included in the Imported Archives jars?

    Hi
    Does SAP PI 7.0 support static initialization of java code included in the Imported Archives jars?
    Static block of a java class included in the Imported Archive jars throws a Runtime Exception called ExceptionInInitializationError while trying to run.
    Regards,
    RDS

    Have you tested the code outside PI?

  • C++ equivalent to static initialization?

    (I apologize if this question is a little off-topic...)
    I'm having trouble finding a good C++ idiom that's equivalent to Java's static member initialization. All the dang C++ books give completely trivial examples for static member initialization, but I need to initialize a complex object.
    A Java example of this is:public class Test {
        final private static Map s_datamap = new HashMap();
        static {
            s_datamap.put("foo", "bar");
            s_datamap.put("blat", "blaz");
    }This is (as far as I can tell) not straightforward to do in C++.
    The best solution I've found so far uses a helper class and chained method calling to initialize the complex object, but it seems a bit kludgy (let me know if you want me to post an example).
    Anyone have a good way of doing this? Is there a better place to ask such a question?
    Much thanks,
    dwh

    Actually, I've found a method to do this which seems relatively safe and isn't too ugly. It's a variation on a static singleton technique and looks like it will be thread-safe. Need to test it some more. If anyone wants the gory details, let me know.
    And yeah, sellhorn, I would much rather be doing this whole thing in Java, but it's not an option. sigh
    What I have discovered is that it's turned out to be incredibly efficient to prototype in Java and then move it to C++ once I'm comfortable with my class hierarchy, general implementation approach, etc.
    We've done this once already with another part of this project, and now I'm doing it again.

  • When trying to launch a Java preferences get this message:  Cannot launch Java application A static initializer of the main class threw an exception: java.lang.NullPointerException"

    I have an IMac 10.5.8 and I am having problems with Java. I have tried todownload Java for Mac OS X 10.5 Update 4 and it looks as if it is doingsuccessfully, but I cannot see where it has put it and get this message when trying to launch Java preferences:
    Cannotlaunch Java application
    A static initializer of the main class threw an exception:java.lang.NullPointerException"
    Couldyou please help?

    Hmm, only way I know would be a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.

  • Initializer block not called when static method called

    public class Initializer {
         Initializer(){
              System.out.println("Constructor called");
                   System.out.println("CLASS INITIALIZED");
         static void method(){
              System.out.println("Static method called");
         public static void main(String[] args) {
              Initializer.method();
    From the JLS
    A class or interface type T will be initialized immediately before the first occurrence of any one of the following:
    T is a class and an instance of T is created.
    T is a class and a static method declared by T is invoked.
    [b]
    But when i call the static method , if the class is initialized shouldnt the initializer block be called, it is not called, why.

    Perhaps running something like this will add a little more colour?:
    public class Initializer {
        static {
            System.out.println("First static initializer");
            System.out.println("First instance initializer");
        Initializer() {
            System.out.println("Constructor");
        static {
            System.out.println("Second static initializer");
            System.out.println("Second instance initializer");
        static void staticMethod() {
            System.out.println("staticMethod");
        void instanceMethod() {
            System.out.println("instanceMethod");
        public static void main(String[] args) {
            System.out.println("main");
            staticMethod();
            new Initializer().instanceMethod();
    }

  • Session variable and initialization block issues

    We are using OBIEE 10.1.3.3 and utilizes built in security features. (No LDAP or other single sign on). The user or group names are not stored in any external table. I have a need to supplement Group info of the user to the usage tracking we implemented recently as the NQ_LOGIN_GROUP.RESP column contains username instead of group name. So I created a session variable and associated with a new initialization block and also had a junk default value set to the variable. In the initialization block, I wrote the following query and as a result it inserted correct values into the table when the TEST button was clicked from the initialization block form.
    insert into stra_login_data (username, groupname, login_time) values ('VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)', SYSDATE)
    My intention is to make this execute whenever any user logs on. The nqserver.log reports the following error and it doesn?t insert values into the table.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.USER, has no value definition.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.GROUP, has no value definition.
    When I changed the insert statement as below, this does get populated whenever someone logs in. But I need the values of GROUP associated with the user as defined in the repository.
    insert into stra_login_data (username, groupname, login_time) values ('TEST_USER', TEST_GROUP', SYSDATE)
    Could someone help me out! As I mentioned above, I need the GROUP info into the usage tracking. So, if there is another successful approach, could you please share?
    Thank you
    Amin

    Hi Amin,
    See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3376946&#3376946]. You can't use the GROUP session variable in an Init Block unless it has been seeded from an Init Block first. There isn't an easy solution for what you want, but here are some options:
    1) Create a copy of your User => Groups assignments in your RPD in an table so you can use it in your Usage Tracking Subject Area. But this means you will have to replicate the changes in two places so it's not a good solution.
    2) As the GROUP session variable is populated when you login you could theoretically use it a Dashboard and pass it a parameter to write the value to the database. But as I am not sure how can you make fire only once when the user logins it sounds like a bad idea.
    3) Move your User => Groups assignments from your RPD to a DB table. Use OBIEE Write Back or something like Oracle APEX to maintain them.
    I think 3) is the best solution to be honest.

Maybe you are looking for

  • Error while starting performance analyzer

    I've tried to run the performance analyzer in a simple C project and I've got this error message: "...***Error: log dos not show target starting" Any ideas of how can I fix it? Thanks in advance Rodrigo Tripodi

  • IPAD:How to configure e-mail account with libero paramiters

    hi eveybody... i bought an i-pad2 and i have some problem to configure account of e-mail with libero provider. i tried to follow some guides on internet, but doesn't works. i have a macbook...and to configure my email on it, i had to find a little pr

  • Alternative ways to bookmark/create desktop icons?

    I am trying to add a webpage as an icon on my desktop on my iPad using the feature provided in Safari but the webpage redirects when I try to access it and I can only bookmark the URL after it is redirected. Does anyone know of a way to make the icon

  • XP suddenly won't recognize Jukebo

    I have XP SP installed. XP always used to recognize my Creative Nomad Jukebox 3. Then itstopped doing so. Nothing happens when I plug it in either with the firewire or the usb2connection. If I go the Add New Hardware route, it is listed under 994 or

  • How to unjam sleep/power button? iPod touch 4th generation

    A few days ago, I was using my ipod touch 4th generation. It working fine. A minute later, I went to use it again, & for some reason my sleep/power button was jammed. I have to use immense pressure to make it go to sleep. Is there a way I could get i